repos:
- repo: local
hooks:
- id: fmt
name: Rust format
entry: cargo +nightly fmt --all
language: system
types: [rust]
files: \.rs$
pass_filenames: false
- id: clippy
name: Run clippy linter
entry: cargo +nightly clippy --all-targets --all-features -- -D warnings
language: system
types: [rust]
files: \.rs$
pass_filenames: false
- id: cargo-check
name: Run cargo check
entry: cargo +nightly check --all-targets --all-features
language: system
types: [rust]
files: \.rs$
pass_filenames: false
- id: cargo-about-json
name: Generate list of licenses in JSON
entry: scripts/generate_about_json.sh
language: script
types_or: [file, rust]
files: "Cargo.toml$"
pass_filenames: false
- id: cargo-about-md
name: Generate list of licenses in Markdown
entry: scripts/generate_about_md.sh meta/licenses.hbs
language: script
types_or: [file, rust]
files: "Cargo.toml$"
pass_filenames: false
- id: cargo-toml-lint
name: Check Cargo.toml
entry: cargo-toml-lint
language: system
types_or: [file, rust]
files: "Cargo.toml$"
pass_filenames: true
- id: vale-lint
name: Run Vale linter
entry: vale
language: system
types: [markdown]
files: "^(README.md|CONTRIBUTING.md|CODE_OF_CONDUCT.md|guide/src/.*.md)$"
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.0
hooks:
- id: commitizen
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-json
exclude: ".vscode/.*json"
- id: check-merge-conflict
- id: no-commit-to-branch
args:
- --branch
- main
- --branch
- next
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-xml
- id: check-yaml
- id: end-of-file-fixer
exclude: ".*licenses.*\\.(md|hbs)"
- id: mixed-line-ending
args:
- --fix=no
- id: pretty-format-json
exclude: ".vscode/.*json"
args:
- --indent=4
- --autofix
- --no-ensure-ascii
- id: trailing-whitespace
exclude: "licenses_report.md"
args:
- --markdown-linebreak-ext=md
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- args:
- build
- chore
- ci
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
- bump
id: conventional-pre-commit
stages:
- commit-msg
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
exclude: ".github/workflows/.*\\.ya?ml"
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
args:
- --ignore
- CHANGELOG.md
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args:
- "--baseline"
- ".secrets.baseline"
exclude: "meta/licenses.*"
- repo: https://github.com/sirosen/texthooks
rev: 0.6.7
hooks:
- id: fix-smartquotes
exclude: "licenses_report.json"
- id: fix-ligatures
- id: forbid-bidi-controls
- repo: https://github.com/zricethezav/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
- repo: https://github.com/fsfe/reuse-tool
rev: v4.0.3
hooks:
- id: reuse