-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pylint
] Do not report calls when object type and argument type mismatch, remove custom escape handling logic (PLE1310
)
#15984
Conversation
|
0186a72
to
0e651b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Function doc comment needs an update, and I'm confused about why we changed the behavior for Python versions below 3.9.
crates/ruff_linter/src/rules/pylint/rules/bad_str_strip_call.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pylint/rules/bad_str_strip_call.rs
Outdated
Show resolved
Hide resolved
0e127ec
to
034e3dd
Compare
crates/ruff_linter/src/rules/pylint/rules/bad_str_strip_call.rs
Outdated
Show resolved
Hide resolved
…match, remove custom escape handling logic (`PLE1310`)
7afba27
to
b91ab6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…15985) ## Summary Follow-up to #15984. Previously, `PLE1310` would only report when the object is a literal: ```python 'a'.strip('//') # error foo = '' foo.strip('//') # no error ``` After this change, objects whose type can be inferred to be either `str` or `bytes` will also be reported in preview. ## Test Plan `cargo nextest run` and `cargo insta test`.
Summary
Resolves #15968.
Previously, these would be considered violations:
...while these are not:
Ruff will now not report when the types of the object and that of the argument mismatch, or when there are extra arguments.
Test Plan
cargo nextest run
andcargo insta test
.