-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace Flake8 with Ruff? #11534
Comments
have you tried to run it locally on mne? does it lead to many different errors than flake8? |
Yes, I get almost 1000 errors, most of them (>99%) F401 (imported but unused). I tried passing the same config that we use, but I'm not sure if that worked (probably not, because we ignore |
I managed to provide our config, and now the errors are down to 7:
I still don't know how many rules that we use are not checked. |
ok it seems it's a doable transition. Feel free to give it a try in a PR |
Currently, Ruff does not include PEP8 style checks, but these will be available very soon. As a quick reminder to the person implementing the PR (probably me), we run Flake8 in
This has to be translated to Ruff. Is it possible to get a list of rules that Flake8 checks with our config? We are only explicitly stating ignores, but I'd like to get a list of "not ignores". |
Don't know offhand, IIRC somewhere in the flake8 docs it say what the defaults are |
crossref to mne-tools/mne-bids-pipeline#686 and mne-tools/mne-bids-pipeline#688 in case it's helpful |
I'm especially keen on adding Ruff as a pre-commit hook, so that style errors (once they're supported) are caught before pushing to the remote |
Thanks for the crossrefs, I didn't know that you had already discussed this! I'm also a fan of precommit, and because we're already using black we don't even have to wait for Ruff to support style checks. Black, Ruff, and Codespell should be all we need, right? |
See #11541. |
Keep in mind those links are to mne-bids-pipeline where we have black+pre-commit IIRC. MNE-Python itself does not. We plan to go to black, but haven't done it yet: #10641 It would be good to use black for 1.4, maybe now is the time... |
Yes, in #11541 only Codespell and Ruff are currently working, and I can only enable Black once someone has gone over the entire codebase. |
I recently discovered Ruff, a replacement for Flake8 written in Rust (but available on PyPI), which is 10x–100x faster. Do you think we can/should use it in our CI?
The text was updated successfully, but these errors were encountered: