Merged
Conversation
MichaReiser
commented
Nov 20, 2024
| if checker.enabled(Rule::NonAsciiImportName) { | ||
| pylint::rules::non_ascii_module_import(checker, alias); | ||
| } | ||
| // TODO(charlie): Remove when stabilizing A004. |
Member
Author
There was a problem hiding this comment.
Thanks @charliermarsh for adding the TODO comments. I would have missed this otherwise!
Contributor
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| A004 | 66 | 66 | 0 | 0 | 0 |
| A001 | 1 | 0 | 1 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
4f95abf to
b61eda2
Compare
90eeb47 to
4da3676
Compare
Member
Author
|
The ecosystem checks look correct to me and they also highlight why it's important that A001 and A004 are different rules. A004 seems slightly more annoying because it requires changes on the user side where A001 prevents naming conflicts on the definition side (which seems preferrable in my view) |
AlexWaygood
approved these changes
Nov 20, 2024
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_import_shadowing.rs
Show resolved
Hide resolved
ceeb260 to
13122ce
Compare
Merged
MichaReiser
added a commit
that referenced
this pull request
Nov 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stabilize
A004.Stabilizing
A004requires a breaking change toA001(see #12546)Before,
A001used to flag shadowed builtins forimportandfrom ... importstatements.Keep doing so now would overlap with
A004. That's why this PR also stabilizes the behavior change to stop flagingimportandfrom ... importbuiltin shadowing inA001.Test Plan
I reviewed the test changes and verified that the no-longer flagged violations by
A001are now flagged byA004