-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Add Ruff config #2583
Add Ruff config #2583
Conversation
Those fix ruff warnings like: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
Weird we didn't catch those before
@phw ruff could replace isort, pylint, and flake8 we have configs for, so that's a first step. I created a separated workflow for now, but we may want to actually replace pylint in existing workflows. Those related to raise ... from are trickier, most of times we want to use from parent exception, but in case we actually handle it, so I tried to stick to some ... logic. A review is very needed though ;) Question: should'nt we write a proper pyproject.toml with a project section now? |
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.
I didn't know about ruff, but this definitely looks like a simplification. Would of course be interesting to have this integrated into codacy (astral-sh/ruff#13391). Then we could really have only one tool.
It already found quite some things. Especially the missing raise ... from ...
are already an annoyance when looking at some error logs with the "during handling of the error..." messages.
I added astral-sh/ruff-action@v3
to the allowed actions, so we can see how this performs here on the next run of this branch.
@zas Generally yes. But we also still need Would be great if all the metadata can stay in |
Suggested in metabrainz#2583 (comment)
Suggested in metabrainz#2583 (comment)
Suggested in metabrainz#2583 (comment)
…alize Note that `rowCount()` doesn't use `parent` at all, kept as comment. Suggested in metabrainz#2583 (comment)
About that, I think we should move to |
Summary
Problem
Solution
Action
Additional actions required: