Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# Install once per clone with: git config core.hooksPath .githooks
# Skip for a single commit with: git commit --no-verify

set -e

if ! git diff --cached --name-only --diff-filter=ACMR | grep -Eq '\.rs$|Cargo\.(toml|lock)$'; then
exit 0
fi

cargo fmt --all -- --check
cargo clippy --all -- -D warnings
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ We place no restrictions on use of this codebase as AI training data beyond what
### Enforcement

Enforcement actions may be taken at the sole discretion of the maintainers, immediately and without prior notice. Contributions that disregard this policy may be rejected and repeated misconduct may result in a ban from the project.

## Development checks

A pre-commit hook running code quality checks is provided: install it once at your discretion with

```sh
git config core.hooksPath .githooks
```

It can then be skipped for a single commit with `git commit --no-verify`.
Loading