-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
chore: move to using Ruff #691
Conversation
I can remove some of the pygrep hooks too, I missed that. |
Big thumbs up from me, love ruff. I've switched to it on a lot of personal projects. The one thing I'd say though is it does get released a lot (not a bad thing at all) so I think if we're going to adopt it I'd like to see us also adopt pre-commit CI to always keep these things up to date for us 👍🏻 @theacodes Is this something you'd be on board with? Would need some |
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
f2fc47c
to
a34a1a5
Compare
While Ruff updates frequently, it's actually more stable than flake8, since it has zero dependencies and is just a binary. So the only forced reason to update would be for new platforms (like a new version of Python), but other than that, it should work indefinitely. Something like a dependency updating can't break it. |
- id: python-check-blanket-noqa | ||
- id: python-check-blanket-type-ignore | ||
- id: python-no-log-warn | ||
exclude: ^tests/test_sessions.py$ |
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.
Ruff's implementation is smarter than a simple grep, so it can tell session.warn isn't logging's warn! :)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
95c6949
to
0f5fa26
Compare
Looks like pyproject-fmt is broken, it just keeps adding an extra line of space between tool.ruff and previous entries. It's also removing space between project headings, which I don't like - I personally like one line between related sections, and two lines between unrelated sections (like tool.stuff sections). Looks like it's tox-dev/pyproject-fmt#69 and will be fixed in tox-dev/pyproject-fmt#70. I'll revert that bump. |
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
The pre commit CI thing was never a blocker for this, just something to consider adopting going forward. Happy to see this come in 👍🏻 |
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.
The pre commit CI thing was never a blocker for this, just something to consider adopting going forward. Happy to see this come in 👍🏻
In that case LGTM!
Ruff can take the place of a lot of other tools, and is 10-100x faster (written in Rust), plugins can't get out of sync, zero dependencies, can auto-fix in some cases, pyproject.toml configuration, and poetry-core updates can't break it (like isort). :)
cibuildwheel, build, scipy, and others have already moved to it.
There are some other nice codes we could enable, but stuck with either what was there before or easy-to-enable (minimal changes) ones.