Skip to content
Merged
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
14 changes: 14 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# SPDX-License-Identifier: MIT OR Apache-2.0

set -e

# just test
cargo --locked nextest run --all-features
cargo test --doc --all-features

# just lint
taplo format --check
taplo lint
cargo fmt --all --check
cargo clippy --examples --tests --benches --all-features --all-targets --locked
6 changes: 6 additions & 0 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ lints: toml-check-fmt toml-lint check-fmt clippy
# Rust all tests
test: unit-test doctest

# Run all code-quality checks
precommit: test lints

# Publish crate to crates.io
publish:
cargo publish --token $CARGO_REGISTRY_TOKEN
Expand All @@ -51,3 +54,6 @@ audit:
# Check GitHub Actions security analysis with `zizmor`
check-github-actions-security:
zizmor .

# Performs one-time repo setup
setup: git config core.hooksPath .githooks
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ you can run the basic CI checks in your local environment:
modern test runner for Rust.
- [`cargo-audit`](https://docs.rs/cargo-audit/latest/cargo_audit/):
tool to check `Cargo.lock` files for security vulnerabilities.

Please do `git config core.hooksPath .githooks` to automatically run these tools on each commit.
Loading