Rust hooks for pre-commit.
This repo was inspired by the pre-commit hooks found in doublify/pre-commit-rust
on 20-Mar-2023.
The code here is released with the 0BSD
license.
Add the following entry to your .pre-commit.yml
- repo: https://github.com/backplane/pre-commit-rust-hooks
rev: v1.1.0
hooks:
- id: fmt
- id: check
- id: clippy
- id: test
Note: The id fmt-check
is also available if you don't want automatic changes.
If you pass an args
list to a hook that receives filename arguments you should end that list with the --
terminator (see below).
- The
fmt
andfmt-check
hooks receive a list of filenames at the end of their arguments. - The
check
,clippy
, andtest
hooks do not receive a list of filenames as arguments.
- repo: https://github.com/backplane/pre-commit-rust-hooks
rev: v1.1.0
hooks:
- id: fmt
args: ['--verbose', '--edition', '2018', '--']