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: v1.41.0
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
types: [markdown]
args:
- --config=.config/lychee.toml
- 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/(mod|format)\.rs$|src/commands/select/)'
- id: no-std-canonicalize-in-tests
name: no-std-canonicalize-in-tests
description: Use dunce::canonicalize in tests to avoid Windows \\?\ prefix issues
language: pygrep
entry: '\.canonicalize\(\)'
files: '^tests/'
- id: no-direct-cmd-output
name: no-direct-cmd-output
description: Use shell_exec::Cmd instead of cmd.output() for consistent logging
language: pygrep
types: ["rust"]
entry: '\.output\(\)'
exclude: '^(src/shell_exec\.rs|src/commands/select/|src/config/(test|expansion|mod)\.rs|src/config/user/tests\.rs|src/styling/mod\.rs|tests/|benches/)'
ci:
skip: [fmt, clippy, lychee-system, cargo-lock]
autoupdate_commit_msg: "chore: pre-commit autoupdate"