-
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
Stabilize A004
#14480
Stabilize A004
#14480
Conversation
@@ -591,18 +591,7 @@ pub(crate) fn statement(stmt: &Stmt, checker: &mut Checker) { | |||
if checker.enabled(Rule::NonAsciiImportName) { | |||
pylint::rules::non_ascii_module_import(checker, alias); | |||
} | |||
// TODO(charlie): Remove when stabilizing A004. |
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 @charliermarsh for adding the TODO comments. I would have missed this otherwise!
|
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
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) |
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!
crates/ruff_linter/src/rules/flake8_builtins/rules/builtin_import_shadowing.rs
Outdated
Show resolved
Hide resolved
ceeb260
to
13122ce
Compare
Summary
Stabilize
A004
.Stabilizing
A004
requires a breaking change toA001
(see #12546)Before,
A001
used to flag shadowed builtins forimport
andfrom ... import
statements.Keep doing so now would overlap with
A004
. That's why this PR also stabilizes the behavior change to stop flagingimport
andfrom ... import
builtin shadowing inA001
.Test Plan
I reviewed the test changes and verified that the no-longer flagged violations by
A001
are now flagged byA004