chore: introduce the Ruff pre-commit hook to replace a bunch of other code formatters and linter hooks#1419
Conversation
|
@behnazh-w in addition to the existing checks, perhaps it would make sense to add the following:
Now I wouldn’t refer to these as “errors” but some are nice improvements or cleanup. Also, note that there’s a macaron/.pre-commit-config.yaml Lines 203 to 211 in 109edd2 |
…code formatters and linter hooks Signed-off-by: Jens Troeger <jens.troeger@light-speed.de>
…hich had no issues
|
@behnazh-w while we’re at it, I think addressing both DTZ and SIM would make sense because both contribute useful checks as well. |
I agree that they are useful. But I prefer to merge this PR soon and add more changes in follow up PRs. What do you think? |
|
@jenstroeger The PR looks good to me. Are you planning to add more changes? Otherwise, could you please mark it as ready for review? |
I’m easy, happy to add the changes here or in a separate PR.
I could add the above two checkers in this PR, but it sounds like you’d prefer to avoid that. |
OK, if that's something you've already been working on, let's add them to this PR. Thank you! |
|
@behnazh-w I think I’ll skip on the PR is open for review. |
Summary
This change replaces
black,bandit,isort,flake8, andpyupgradegit hooks with a singleruffhook.Description of changes
Ruff is supposed to be a drop-in replacement for the aforementioned checkers, linters, and code formatters and it mostly works. However, it also
FooBarExceptionwhich should be namedFooBarErrorwhich could be considered a breaking change;banditcommentsnosec Bxxxtonoqa: Sxxx.In addition to the rules covering the existing Macaron setup, Ruff provides a bunch of new rules and checkers (e.g. boolean trap) that are probably interesting to add… 🤓
Related issues
n/a
Checklist
verifiedlabel should appear next to all of your commits on GitHub.