-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Pre commit #1763
Pre commit #1763
Conversation
✅ Deploy Preview for maturin-guide ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
.pre-commit-config.yaml
Outdated
language: system | ||
pass_filenames: false | ||
# rustup component add clippy | ||
- id: cargo-clippy |
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 don't think we should add cargo check
and cargo clippy
in pre-commit hooks because they may take a long time which makes the git commit UX bad.
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 was able to set these checks to run only for the 'manual' stage which means only when pre-commit is run with pre-commit run --hook-stage manual --all
.
It's debatable whether another task runner like makefile, cargo make or just would be easier to use for this, but at least pre-commit is able to serve as a commit hook and also as a way to fairly easily run all the checks at once with a single tool.
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.
Thanks!
FYI, I've also set up pre-commit.ci for this repo. |
maturin has various checks that run on the CI so it would be helpful for contributors if they could easily run the same checks locally so they can find out if there is a problem before their code reaches the CI.
pre-commit is a tool used by many projects to run checks before every commit (and can also be run manually with
pre-commit run --all
)