Rust pre-commit hooks for https://pre-commit.com
| .pre-commit-config.yaml | Add README | |
| .pre-commit-hooks.yaml | Add clippy, test, and fmt hooks | |
| LICENSE | Initial commit | |
| README.md | Fix style error in README | |
pre-commit-rust
This repo contains some pre-commit hooks for Rust code, intended to be used with the pre-commit framework.
Setup
Add the repo to your .pre-commit-config.yaml:
- repo:https://codeberg.org/avery42/pre-commit-rust.gitrev:v1.0.0hooks:- id:cargo-clippy- id:cargo-fmt- id:cargo-testAvailable hooks
cargo-clippy
Lints Rust code with Clippy.
You can pass arguments to configure the linter. For example, to elevate warnings to errors:
hooks:- id:cargo-clippyargs:["--","-Dwarnings"]cargo-fmt
Formats Rust code.
cargo-test
Runs tests.