repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
exclude: '.*\.snap$'
- id: check-yaml
- id: mixed-line-ending
- id: trailing-whitespace
exclude: '.*\.(rs|snap)$'
- repo: https://github.com/crate-ci/typos
rev: 802d5794ff9cf7b15610c47eca99cd1ab757d8d4
hooks:
- id: typos
pass_filenames: false
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: fmt
- repo: https://github.com/r0x0d/pre-commit-rust
rev: v1.0.1
hooks:
- id: clippy
args: ["--all-targets", "--all-features", "--", "-D", "warnings"]
- repo: https://github.com/lycheeverse/lychee
rev: lychee-v0.22.0
hooks:
- id: lychee-system
name: lychee (PR mode)
types: [markdown]
args:
- --config=.config/lychee.toml
- -q
- id: lychee-system
name: lychee-all (comprehensive)
types: [markdown]
stages: [manual]
args:
- --config=.config/lychee.toml
- -q
- repo: local
hooks:
- id: cargo-lock
name: cargo-lock
description: Ensure Cargo.lock is in sync with Cargo.toml
language: system
entry: cargo check --locked
pass_filenames: false
files: (Cargo\.toml|Cargo\.lock)$
- id: no-dbg
name: no-dbg
description: We shouldn't merge code with `dbg!` in
language: pygrep
types: ["rust"]
entry: "dbg!"
- id: no-manual-ansi
name: no-manual-ansi
description: Use anstyle/osc8/strip-ansi-escapes instead of manual ANSI codes
language: pygrep
types: ["rust"]
entry: '\\x1b\['
exclude: '^(tests/|.*_test\.rs$|src/styling/(line|mod|format)\.rs$|src/output/global\.rs$|src/cli\.rs$)'
ci:
skip: [fmt, clippy, lychee-system, cargo-lock]
autoupdate_commit_msg: "chore: pre-commit autoupdate"