default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: local
hooks:
- id: file-line-count
name: file line count (< 1000)
entry: scripts/hooks/check_file_line_count.sh
language: system
types: [rust]
- id: dir-file-count
name: directory file count (<= 10)
entry: scripts/hooks/check_dir_file_count.sh
language: system
pass_filenames: false
always_run: true
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --all --check
language: system
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features -- -D warnings
language: system
pass_filenames: false
- id: cargo-test
name: cargo test
entry: cargo test --all-targets --all-features
language: system
pass_filenames: false
stages: [pre-push]
- id: cargo-audit
name: cargo audit
entry: cargo audit --deny warnings
language: system
pass_filenames: false
stages: [pre-push]
- id: cargo-doc
name: cargo doc
entry: cargo doc --no-deps --all-features
language: system
pass_filenames: false
stages: [pre-push]
- id: cargo-coverage
name: cargo coverage
entry: cargo llvm-cov --workspace --all-targets --all-features --lcov --output-path lcov.info
language: system
pass_filenames: false
stages: [pre-push]