[flake8-bultins] Detect class-scope builtin shadowing in decorators, default args, and attribute initializers (A003)#20178
Conversation
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| A003 | 2 | 2 | 0 | 0 | 0 |
|
We can have this PR expanded to cover #20179 too if it makes sense, since they are in the same scope. Let me know! |
ntBre
left a comment
There was a problem hiding this comment.
Thanks, this looks right to me!
Would you mind gating this behind preview? I thought it was a bug fix when I labeled the issue, but it is likely to cause new diagnostics, as the ecosystem check shows, and I'm a bit wary of reintroducing the issues fixed in #9462, when the first_non_type_parent_scope_id check was added.
The structure of the A001 check looks a bit different to me, so let's leave that for a follow-up PR.
| if reference_scope_id == scope_id { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
I think this is the part that needs to be preview-gated right? The check currently inside of the preview check is the code we had before.
There shouldn't be any stable changes in the ecosystem report. We may also need to add a preview test runner.
ntBre
left a comment
There was a problem hiding this comment.
Thank you! I pushed one commit running the new tests in preview, but the results look good to me.
Summary
Fix #20171