-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Enable ruff flake8-builtins
rule
#2930
Enable ruff flake8-builtins
rule
#2930
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2930 +/- ##
=======================================
Coverage 99.64% 99.64%
=======================================
Files 116 116
Lines 17503 17503
Branches 3148 3148
=======================================
Hits 17441 17441
Misses 43 43
Partials 19 19
|
Why is this three separate PRs that will all conflict due to all three reformattting the pyproject.toml? |
Because they are separate rules, and if they conflict I will deal with that. |
The segfault in pypy-3.9 happened again: https://github.com/python-trio/trio/actions/runs/7607032357/job/20713702030#step:5:1186 |
Gah, well see the segfaults don't exactly provide much information... But I agree that it's annoying. At this point ig we might as well make an issue here (on trio) to track things cause upstream pytest hasn't been able to solve this yet. Also, I don't really see the use of this rule. We have type checkers; I don't see the issue with this shadowing. Maybe others see issue though? |
In all reality we might not need |
I'm in favor of not shadowing builtins in general, type checking might catch most errors it might lead to (only if the object is different though!) - but I can definitely see it causing confusion/lead to bugs/etc. |
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.
actually, after reading through all the diffs I think we should ignore A002
- but we could keep A001
. We're never going to change the argument names for external-facing functions, and I'm not sure it's worth the need for lots of ugly noqa
s to be extra safe on internal functions.
Co-authored-by: jakkdl <h6+github@pm.me>
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.
Looks great!
This pull request enables ruff's
flake8-builtins
rule, sorts the enabled rules and ignored rules sections, and fixes or ignores a lot of newly generated "argument or variable is shadowing a python builtin" errors.