Skip to content

Conversation

felix314159
Copy link
Collaborator

@felix314159 felix314159 commented Sep 12, 2025

🗒️ 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, but 0.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

  • All: Ran fast 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
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

@spencer-tb spencer-tb added type:chore Type: Chore scope:tooling Scope: Python tools (uv, ruff, tox,...) labels Sep 16, 2025
@spencer-tb spencer-tb changed the title chores(ruff_rule): enforce rule c420 chore(tooling): enforce ruff rule c420 Sep 16, 2025
Copy link
Contributor

@spencer-tb spencer-tb left a 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" 🌿

@spencer-tb
Copy link
Contributor

cc @danceratopz for second opinion and merge! :D

Copy link
Member

@danceratopz danceratopz left a 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.

@felix314159 felix314159 merged commit 8f872a0 into ethereum:main Sep 18, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tooling Scope: Python tools (uv, ruff, tox,...) type:chore Type: Chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants