-
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
] Preserve original value format (PLR6104
)
#14978
Conversation
|
The existing implementation is surprisingly complex. On top of that, it uses the generator to create the fix, but that's not strictly necessary. String slicing is much simpler and only requires an extra hardcoded |
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. Could you revert your changes to AugmentedOperator
(and, if there are any, other refactors that aren't strictly necessary for the fix). I'd prefer to keep the changes minimal to the fix or have separate PRs for refactor and fix.
crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs
Outdated
Show resolved
Hide resolved
I'd like to believe it isn't my fault that the |
I believe it's due to one of the mdformat plugins we use having released a new version. We don't have these pinned in our pre-commit config file; we probably should. Two of the plugins we use cut new releases a couple of hours ago, one of them a major version bump: |
I filed #14992 to fix the pre-commit issue. |
crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs
Outdated
Show resolved
Hide resolved
…ment.rs Co-authored-by: Alex Waygood <[email protected]>
crates/ruff_linter/resources/test/fixtures/pylint/non_augmented_assignment.py
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/pylint/rules/non_augmented_assignment.rs
Outdated
Show resolved
Hide resolved
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
Summary
Resolves #11672.
Test Plan
cargo nextest run
andcargo insta test
.