-
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
Fix PLW1508
false positive for default string created via a mult operation
#14841
Fix PLW1508
false positive for default string created via a mult operation
#14841
Conversation
|
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.
Thanks!
Agreed -- I fixed it by splitting out the |
Wonderful thanks ! Btw, just wanted to say that the dev onboarding was really simple. The |
…LW1508`) (#16674) ## Summary This PR stabilizes the new behavior introduced in #14512 to also detect defalut value arguemnts to `os.environ.get` that have an invalid type (not `str`). There's an upstream issue for this behavior change pylint-dev/pylint#10092 that was accepted and a PR, but it hasn't been merged yet. This behavior change was first shipped with Ruff 0.8.1 (Nov 22). There has only be one PR since the new behavior was introduced but it was unrelated to the scope increase (#14841).
…LW1508`) (#16674) ## Summary This PR stabilizes the new behavior introduced in #14512 to also detect defalut value arguemnts to `os.environ.get` that have an invalid type (not `str`). There's an upstream issue for this behavior change pylint-dev/pylint#10092 that was accepted and a PR, but it hasn't been merged yet. This behavior change was first shipped with Ruff 0.8.1 (Nov 22). There has only be one PR since the new behavior was introduced but it was unrelated to the scope increase (#14841).
…LW1508`) (#16674) ## Summary This PR stabilizes the new behavior introduced in #14512 to also detect defalut value arguemnts to `os.environ.get` that have an invalid type (not `str`). There's an upstream issue for this behavior change pylint-dev/pylint#10092 that was accepted and a PR, but it hasn't been merged yet. This behavior change was first shipped with Ruff 0.8.1 (Nov 22). There has only be one PR since the new behavior was introduced but it was unrelated to the scope increase (#14841).
Summary
Fix a false positive for default string created via a mult operation.
I find the
if matches!(op, Operator::Mult)
branch inside theOperator::Mult
match quite inelegant but was not sure of the most idiomatic way to handle this.Test Plan
cargo nextest run
andcargo insta test
.