default_stages: [pre-commit]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
exclude: ^(target/|fuzz/corpus/)
- id: end-of-file-fixer
exclude: ^(target/|fuzz/corpus/|.*\.bin$|.*\.der$|.*\.pem$)
- id: mixed-line-ending
args: [--fix=lf]
exclude: ^(target/)
- id: check-yaml
args: [--unsafe] - id: check-json
exclude: ^(target/)
- id: check-toml
- id: detect-private-key
exclude: ^(certs/|test.*certs/|.*test.*\.pem$)
- id: check-added-large-files
args: [--maxkb=1024]
exclude: ^(target/)
- id: check-merge-conflict
- id: check-case-conflict
- id: check-symlinks
- id: destroyed-symlinks
- id: check-executables-have-shebangs
exclude: ^(target/)
- id: check-shebang-scripts-are-executable
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [--severity=warning]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: [--fix, --disable, MD013, MD033, MD041, MD024, --]
exclude: ^(CHANGELOG\.md)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
exclude: ^(\.gitlab-ci\.yml|docker-compose.*\.yml)
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args: [--ignore, DL3008, --ignore, DL3013, --ignore, DL3015, --ignore, DL3018]
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt (check)
entry: cargo fmt -- --check
language: system
files: \.rs$
exclude: ^(target/)
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy --all-targets --all-features -- -D warnings
language: system
files: \.(rs|toml)$
exclude: ^(target/)
pass_filenames: false
stages: [pre-commit]
- id: cargo-check
name: cargo check
entry: cargo check --all-targets --all-features
language: system
files: \.(rs|toml)$
exclude: ^(target/)
pass_filenames: false
stages: [pre-commit]
- id: cargo-test
name: cargo test
entry: cargo test --lib
language: system
files: \.(rs|toml)$
exclude: ^(target/)
pass_filenames: false
stages: [pre-push]
- id: cargo-test-proptest
name: cargo test proptest
entry: cargo test --test proptest
language: system
files: \.(rs|toml)$
exclude: ^(target/)
pass_filenames: false
stages: [pre-push]
- id: check-todos
name: check for TODOs/FIXMEs
entry: bash
args:
- -c
- |
git diff --cached --name-only | xargs grep -l -E "(TODO|FIXME|XXX|HACK)" 2>/dev/null && echo "Warning: Found TODO/FIXME markers in staged files" && exit 0 || exit 0
language: system
pass_filenames: false
verbose: true
ci:
autofix_prs: true
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
For more info see https://pre-commit.ci
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: [cargo-fmt, cargo-clippy, cargo-check, cargo-test, cargo-test-proptest]
submodules: false