-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat(all): add ruff
as default linter and additional clean up
#922
Conversation
ruff
as the default linter for EEST
ruff
as the default linter for EESTruff
as default linter and additional clean up
b3f6ae4
to
5e61b48
Compare
@spencer-tb could we rebase this to main please? I think it would make it easier to spot issues in the CI if we include the fixes from #905 |
a32b069
to
f80467a
Compare
7349bc7
to
ee354f9
Compare
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.
Some comments:
- I have only tested out filling. We get the same index root hash as main. It would be nice for others to test out consume, execute and other clis.
- Tox passes
tests/framework/docs
for me locally and in the CI with the new changes. 😄 - I noticed that running
mypy
locally outside of tox gave me a lot of errors. These errors are not flagged during tox runs. This is a similar behaviour to main, however with the ruff changes there are substantially more. I think this is okay but its worth looking into.
Quoting the remaining todo's here:
- Investigate all the new mypy error when running
uv run mypy src/tests
locally.- Not these don't exist when running tox locally but its a similar behaviour to main just more errors.
- Update
src/cli/gentest/source_code_generator.py
to use ruff instead of black. - Add
codespell
for spell checking. - Remove all the
noqa:
andtype: ignore
adding an appropriate solution.
ee18346
to
824b49f
Compare
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.
Amazing job!
I will rebase, and double-check on the --fix
/--no-fix
parameters, then merge.
This was required after upgrading ruff from 0.7.1 to 0.8.2
This was required after upgrading ruff from 0.7.1 to 0.8.2
824b49f
to
a8b0a68
Compare
…reum#922) * feat: use ruff for linting. * chore: overhaul `.vscode` files. * chore(ruff): changes to `src/cli`. * chore(noqa|todo): changes to `src/cli`. * chore(tf): remove `tf` from the repo. * chore(ruff|noqa): changes to `src/config`. * chore(ruff): changes to `src/ethereum_clis`. * chore(noqa): changes to `src/ethereum_clis`. * chore(ruff): changes to `src/ethereum_test_base_types`. * chore: remove `.flake8` config. * chore(ruff): changes to `src/cli` after rebase. * chore(ruff): changes to `src/ethereum_clis` after rebase. * chore(ruff): changes to `src/ethereum_test_base_types` after rebase. * chore(ruff): changes to `src/ethereum_test_exceptions`. * chore(ruff): changes to `src/ethereum_execution`. * chore(ruff): changes to `src/ethereum_test_fixtures`. * chore(ruff): changes to `src/ethereum_test_forks`. * chore(ruff): changes to `src/ethereum_test_rpc`. * chore(ruff): changes to `src/ethereum_test_specs`. * chore(ruff): changes to `src/ethereum_test_tools`. * chore(ruff): changes to `src/ethereum_test_types`. * chore(ruff): changes to `src/ethereum_test_vm`. * chore(ruff): changes to `src/conftest.py`. * chore(ruff): changes to `src/pytest_plugins`. * chore(ruff): changes to `tests/shanghai`. * chore(ruff): changes to `tests/prague`. * chore(ruff): changes to `tests/paris`. * chore(ruff): changes to `tests/osaka`. * chore(ruff): changes to `tests/istanbul`. * chore(ruff): changes to `tests/homestead`. * chore(ruff): changes to `tests/frontier`. * chore(ruff): changes to `tests/constantinople`. * chore(ruff): changes to `tests/cancun`. * chore(ruff): changes to `tests/byzantium/`. * chore(ruff): changes to `tests/berlin`. * chore(ruff): changes to `src` to fix filling. * chore: mypy fixes part 1. * chore: mypy fixes part 2. * chore(docs): update changelog. * chore(docs): update ruff in docs. * tests: fix eip2537 ruff changes. * chore: revert uv.lock to 88c1401 for a gentler package upgrade * chore: only add ruff & remove isort etc to/from deps in uv.lock * chore: pin ruff to version 0.8.2 * style(lint): fix docstrings in github script * style(lint): fix python builtin shadowing (in ruff 0.8.2) This was required after upgrading ruff from 0.7.1 to 0.8.2 * style(lint): fix import block (in ruff 0.8.2) This was required after upgrading ruff from 0.7.1 to 0.8.2 * fix(tox.ini): Add ruff format checks * fix(fw): Formatting * fix(tests): Formatting --------- Co-authored-by: danceratopz <[email protected]> Co-authored-by: Mario Vega <[email protected]>
🗒️ Description
Adds
ruff
as our default lint/format/import checker replacingflake8
,black
&isort
.Extra clean-up items are mentioned below.
From this point onwards we should strictly make sure our code adheres to the best Python standards.
🧑💻
.vscode
The
settings.recommended.json
has be split into 2 files:settings.json
: locked config that users of the repo MUST use..settings.local.recommended.json
: settings that users can change, for example python testing extension related.💥 Removal of
tf
It seems relevant for us to deperate
tf
now. Most repo users are familiar with theuv fill
etc approach now.📜 Ruff Related Docstring Changes
A large portion of the diff comes from changes to the python docstrings, via:
With a new linter its seems logical to enforce python docstring standards from now on. Note the warnings appear within VSCode and additionally when running tox. This required a lot of manual intervention to update our docstrings to use imperative mood.
🔑 Key Notes & Checks
index.json
root hash asupstream/main
.🔗 Related Issues
☑️ Remaining Todos
uv run mypy src/tests
locally.src/cli/gentest/source_code_generator.py
to use ruff instead of black.codespell
for spell checking. Note this PR removesfname8
.noqa:
andtype: ignore
adding appropriate solutions.✅ Checklist