-
Notifications
You must be signed in to change notification settings - Fork 171
chore(tooling): enforce ruff rule c420 #2146
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
Conversation
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.
Works for me locally! LGTM! 🍃 "cough 420" 🌿
cc @danceratopz for second opinion and merge! :D |
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 @felix314159! I'd prefer to keep the hex representations as they're shorter & easier to read. In particular, the decimal representation of 0xDEADBEEF makes the choice unclear.
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
🗒️ Description
Rule C420 is unnecessary-dict-comprehension-for-iterable (C420).
The 18 errors are only visible in newer ruff versions (e.g.
0.9.6
will show 0 errors, but0.11.8
will show 18 errors). To use the same ruff version that tox will use in CI run.tox/lint/bin/ruff check --no-fix --show-fixes src tests .github/scripts
.Ruff was able to autofix everything with
.tox/lint/bin/ruff check --fix --show-fixes src tests .github/scripts
,I re-ran mypy after that and there are no complaints. Should be safe to merge.
Relevant for #2128
🔗 Related Issues or PRs
N/A.
✅ Checklist
tox
checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
type(scope):
.