minimum_pre_commit_version: 4.0.0
exclude: ^LICENSES/|\.(html|csv|svg)$
default_stages: [pre-commit]
ci:
autofix_prs: false
autoupdate_schedule: monthly
repos:
- repo: https://gitcode.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ["--allow-multiple-documents"]
exclude: mkdocs\.yml$
- id: check-added-large-files
- id: check-merge-conflict
- id: detect-private-key
- id: check-json
- id: no-commit-to-branch
- repo: https://gitcode.com/gh_mirrors/ru/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff-check
args: [--output-format, github, --fix, --line-length=120]
types: [python]
- id: ruff-format
args: [--line-length=120]
types: [python]
- repo: https://gitcode.com/gh_mirrors/co/codespell
rev: v2.4.1
hooks:
- id: codespell
exclude: 'pre-commit/typos.toml'
args: [
"-L",
"CANN,cann,NNAL,nnal,ASCEND,ascend,EnQue,CopyIn,ArchType,AND,ND,tbe,copyin,alog,chage,aNULL,infor",
"--skip",
"*.py,*.cpp,*.hpp,*.c,*.h",
]
- repo: https://gitcode.com/gh_mirrors/ty/typos
rev: v1.32.0
hooks:
- id: typos
args: ["--force-exclude", "--config", "pre-commit/typos.toml"]
- repo: https://gitcode.com/pre-commit-clang/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx)$
types_or: [c, c++]
args: ["--style={BasedOnStyle: google, IndentWidth: 4, ColumnLimit: 120}"]
exclude: ^build/|^tests/third_party/
- repo: https://gitcode.com/gh_mirrors/ma/markdownlint-cli
rev: v0.46.0
hooks:
- id: markdownlint
exclude: '.*\.inc\.md$|.*report_template\.md$|.*contributors\.md$|.*PULL_REQUEST_TEMPLATE\.md$'
stages: [manual]
description: "Markdown format check (run in CI: pre-commit run markdownlint --all-files)"