1
0
Fork
You've already forked pre-commit-rust
0
Rust pre-commit hooks for https://pre-commit.com
2023年11月04日 21:14:53 -04:00
.pre-commit-config.yaml Add README 2023年11月04日 21:09:58 -04:00
.pre-commit-hooks.yaml Add clippy, test, and fmt hooks 2023年11月04日 20:42:52 -04:00
LICENSE Initial commit 2023年11月04日 20:26:50 -04:00
README.md Fix style error in README 2023年11月04日 21:14:53 -04:00

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-test

Available 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.