2025-01-07 13:47:00 +08:00
|
|
|
default_stages: [commit]
|
|
|
|
|
repos:
|
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
|
rev: v5.0.0
|
|
|
|
|
hooks:
|
|
|
|
|
- id: no-commit-to-branch
|
|
|
|
|
args: [--branch, main, --pattern, 1_.*_X]
|
|
|
|
|
- id: check-added-large-files
|
|
|
|
|
- id: check-byte-order-marker
|
|
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
|
- id: forbid-new-submodules
|
|
|
|
|
- id: check-yaml
|
|
|
|
|
exclude: '.clang-format'
|
|
|
|
|
- id: check-json
|
|
|
|
|
- id: pretty-format-json
|
|
|
|
|
args: ['--no-sort-keys', '--autofix']
|
|
|
|
|
- id: check-symlinks
|
|
|
|
|
- id: check-xml
|
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
|
types_or: [c, shell, python, proto]
|
|
|
|
|
- id: trailing-whitespace
|
|
|
|
|
types_or: [c, shell, python, xml]
|
|
|
|
|
- id: check-docstring-first
|
|
|
|
|
- id: check-merge-conflict
|
|
|
|
|
- id: mixed-line-ending
|
|
|
|
|
args: [--fix=lf]
|
2025-01-07 13:49:05 +08:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
|
|
|
|
rev: v2.2.2
|
|
|
|
|
hooks:
|
|
|
|
|
- id: codespell
|
|
|
|
|
args: ['--config', './contrib/codespell.cfg', --write-changes]
|
2025-01-07 14:54:23 +08:00
|
|
|
- repo: https://github.com/ambv/black
|
|
|
|
|
rev: 24.10.0
|
|
|
|
|
hooks:
|
|
|
|
|
- id: black
|
2025-01-07 14:07:18 +08:00
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
|
|
|
rev: v0.38.0
|
|
|
|
|
hooks:
|
|
|
|
|
- id: markdownlint
|
|
|
|
|
args: ['--fix', '--ignore', '.github']
|