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.2.0
hooks:
- id: fmt
- id: check
- id: clippy
- id: testNote: 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
fmtandfmt-checkhooks receive a list of filenames at the end of their arguments. - The
check,clippy, andtesthooks do not receive a list of filenames as arguments.
- repo: https://github.com/backplane/pre-commit-rust-hooks
rev: v1.2.0
hooks:
- id: fmt
args: ['--verbose', '--edition', '2018', '--']