[pylint] Detect pathlib.Path.open calls in unspecified-encoding (PLW1514) #11288
[pylint] Detect pathlib.Path.open calls in unspecified-encoding (PLW1514) #11288dhruvmanila merged 7 commits intoastral-sh:mainfrom
pylint] Detect pathlib.Path.open calls in unspecified-encoding (PLW1514) #11288Conversation
|
I was not able to detect violations of the form I don't know if this is currently doable. |
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| PLW1514 | 76 | 76 | 0 | 0 | 0 |
crates/ruff_linter/src/rules/pylint/rules/unspecified_encoding.rs
Outdated
Show resolved
Hide resolved
|
@dhruvmanila Done as requested.
Any comment on this |
I think it's fine to not detect this now as this would fall under the bucket of type-inference. |
dhruvmanila
left a comment
There was a problem hiding this comment.
Thank you for working on this!
I've added some additional test cases and actually used QualifiedName for the Regular variant. This is to re-use the Display implementation on QualifiedName.
|
The ecosystem changes looks correct. |
|
After a good amount of discussion, I've decided to name it Feel free to disagree with any of the changes made by me. |
Summary
Resolves #11263
Detect
pathlib.Path.opencalls which do not specify a file encoding.Test Plan
Test cases added to fixture.