-
Notifications
You must be signed in to change notification settings - Fork 11
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
Lint with pre-commit #94
Conversation
2043eed
to
17a118e
Compare
If this doesn't feel like a chaiNNer or Spandrel thing to do, that's fine too! |
I personally don't like pre commit hooks, so I appreciate it that this one is optional. The main issue I see with it, is that it's not really optional. You can just choose when to run it (before commit, after push (by CI)) and still have to follow all of its rules. This can actually make not using the pre commit hook less user-friendly since some of the options you enabled (e.g. So I'm not sure about this. |
I personally don't like slow pre-commit hooks either (and don't get me started on slow terminal prompts, ugh), but these are very fast (and this is running everything on all files; in a commit hook, it'd only run on touched files):
That said, I can absolutely get rid of the extra rules and just keep Ruff in :) |
It's not just slow ones. I don't want my commits to fail, well, committing. I'd rather use IDE save actions to see what exactly is committed before committing.
Please do that. We can still re-add them later if need be. |
17a118e
to
de6bc6c
Compare
de6bc6c
to
6b5a2b8
Compare
Alright, with my mistake resolved, I think this is basically ready. Could you please resolve the conflict? Also, we should probably document this in |
6b5a2b8
to
bf31f20
Compare
- id: ruff | ||
args: | ||
- --fix | ||
- --unsafe-fixes |
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 added this as it was mentioned in CONTRIBUTING.md
too.
This PR proposes to
.pre-commit-config.yaml
file to make it possible to use https://pre-commit.com/ to run the Ruff lint and format step (i.e. have everything checked and fixed at commit time (if so desired)).pre-commit/action
.RUFF_OUTPUT_FORMAT
to"github"
, so Ruff outputs warnings in a form that makes GitHub Actions print them quite prettilyadd the basicpre-commit-hooks
hooks to enforce some hygienic line-ending rules (and fixes the handful of issues).This shouldn't affect regular development without
pre-commit
other than having to remember to keep the Ruff version in sync between thelint
extra and the pre-commit config.