| 1 |
# See https://pre-commit.com for more information |
| 2 |
# See https://pre-commit.com/hooks.html for more hooks |
| 3 |
repos: |
| 4 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 5 |
rev: v5.0.0 |
| 6 |
hooks: |
| 7 |
- id: check-added-large-files |
| 8 |
- id: check-executables-have-shebangs |
| 9 |
- id: check-json |
| 10 |
exclude: '\.vscode/(cSpell|extensions)\.json' # cSpell.json and extensions.json use comments |
| 11 |
- id: check-shebang-scripts-are-executable |
| 12 |
exclude: '.+\.rs' # would be triggered by #![some_attribute] |
| 13 |
- id: check-symlinks |
| 14 |
- id: check-toml |
| 15 |
- id: check-yaml |
| 16 |
args: [ --allow-multiple-documents ] |
| 17 |
- id: destroyed-symlinks |
| 18 |
- id: end-of-file-fixer |
| 19 |
- id: mixed-line-ending |
| 20 |
args: [ --fix=lf ] |
| 21 |
- id: trailing-whitespace |
| 22 |
|
| 23 |
- repo: https://github.com/mozilla-l10n/moz-fluent-linter |
| 24 |
rev: v0.4.8 |
| 25 |
hooks: |
| 26 |
- id: fluent_linter |
| 27 |
files: \.ftl$ |
| 28 |
args: [--config, .github/fluent_linter_config.yml, src/uu/] |
| 29 |
|
| 30 |
- repo: local |
| 31 |
hooks: |
| 32 |
- id: rust-linting |
| 33 |
name: Rust linting |
| 34 |
description: Run cargo fmt on files included in the commit. |
| 35 |
entry: cargo +stable fmt -- |
| 36 |
pass_filenames: true |
| 37 |
types: [file, rust] |
| 38 |
language: system |
| 39 |
- id: rust-clippy |
| 40 |
name: Rust clippy |
| 41 |
description: Run cargo clippy on files included in the commit. |
| 42 |
entry: cargo +stable clippy --workspace --all-targets --all-features -- -D warnings |
| 43 |
pass_filenames: false |
| 44 |
types: [file, rust] |
| 45 |
language: system |
| 46 |
- id: cspell |
| 47 |
name: Code spell checker (cspell) |
| 48 |
description: Run cspell to check for spelling errors (if available). |
| 49 |
entry: bash -c 'if command -v cspell >/dev/null 2>&1; then cspell --no-must-find-files -- "$@"; else echo "cspell not found, skipping spell check"; exit 0; fi' -- |
| 50 |
pass_filenames: true |
| 51 |
language: system |