2025-11-24 13:14:08 +08:00
default_install_hook_types :
- pre-commit
- commit-msg
2025-10-24 12:16:48 +08:00
repos :
- repo : https://github.com/pre-commit/pre-commit-hooks
2025-10-24 14:07:04 +08:00
rev : v4.6.0
2025-10-24 12:16:48 +08:00
hooks :
# list of supported hooks: https://pre-commit.com/hooks.html
- id : check-yaml
args : [ "--unsafe" ]
- id : debug-statements
- id : end-of-file-fixer
- id : mixed-line-ending
args : [ "--fix=lf" ]
- id : trailing-whitespace
args : [ "--markdown-linebreak-ext=md" ]
2025-11-17 18:13:05 +08:00
- repo : https://github.com/astral-sh/ruff-pre-commit
2025-11-18 20:54:26 +08:00
rev : v0.14.0
2025-10-24 12:16:48 +08:00
hooks :
2025-11-18 20:54:26 +08:00
- id : ruff-check
args : [ --output-format, github, --fix]
- id : ruff-format
2025-11-17 18:13:05 +08:00
- repo : https://github.com/crate-ci/typos
rev : v1.35.5
hooks :
- id : typos
# only for staged files
- repo : https://github.com/rhysd/actionlint
rev : v1.7.7
hooks :
- id : actionlint
files : ^\.github/workflows/.*\.ya?ml$
2025-11-24 13:14:08 +08:00
- repo : local
hooks :
- id : signoff-commit
name : Sign-off Commit
entry : bash
args :
- -c
- |
if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" "$(git rev-parse --git-path COMMIT_EDITMSG)"; then
printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> "$(git rev-parse --git-path COMMIT_EDITMSG)"
fi
language : system
verbose : true
stages : [ commit-msg]
# Keep `suggestion` last
- id : suggestion
name : Suggestion
entry : bash -c 'echo "To bypass all the pre-commit hooks, add --no-verify to git commit. To skip a specific hook, prefix the commit command with SKIP=<hook-id>."'
language : system
verbose : true
pass_filenames : false
# Insert new entries above the `suggestion` entry