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
- repo: https://gitcode.com/gh_mirrors/ru/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff-check
args: ["--config", "pre-commit/pyproject.toml", "--output-format", "github", "--fix"]
types: [python]
- id: ruff-format
args: ["--config", "pre-commit/pyproject.toml"]
types: [python]
- repo: https://gitcode.com/gh_mirrors/co/codespell
rev: v2.4.1
hooks:
- id: codespell
args: [
"-L",
"CANN,cann,NNAL,nnal,ASCEND,ascend,EnQue,CopyIn,ArchType,AND,ND,tbe,copyin,alog",
"--skip",
"*.toml,*.py,*.cpp,*.hpp,*.c,*.h",
]
- repo: https://gitcode.com/gh_mirrors/pyl/pylint
rev: v4.0.5
hooks:
- id: pylint
name: pylint (Python code quality check)
types: [python]
args: ["--rcfile=pre-commit/pyproject.toml"]
verbose: false
- repo: https://gitcode.com/gh_mirrors/ba/bandit
rev: 1.9.4
hooks:
- id: bandit
name: bandit (Python security vulnerability check)
types: [python]
args: [
"--config=pre-commit/pyproject.toml",
"--quiet",
]
- 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)$
args:
- "--style=file"
- "--verbose"
- "-i"
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt (Rust code formatter)
entry: cargo fmt --manifest-path motor/kv_conductor/Cargo.toml --all
language: system
types: [rust]
files: ^motor/kv_conductor/
pass_filenames: false
- id: cargo-clippy
name: cargo clippy (Rust linter)
entry: cargo clippy --manifest-path motor/kv_conductor/Cargo.toml -- -D warnings
language: system
types: [rust]
files: ^motor/kv_conductor/
pass_filenames: false
- repo: local
hooks:
- id: check-header
name: header check & cleanup
entry: pre-commit/check_header.py
language: python
types: [python]
exclude: >
(?x)^(
pre-commit/|
build/|
.*_pb2\.py$|
.*_pb2_grpc\.py$|
.*_grpc\.py$|
.*\.egg-info/|
.*__pycache__/
)
pass_filenames: true
- id: check-modern-typing
name: modern python typing check
entry: pre-commit/check_modern_typing.py
language: python
types: [python]
exclude: >
(?x)^(
deployer/|
build/|
.*_pb2\.py$|
.*_pb2_grpc\.py$|
.*_grpc\.py$|
.*\.egg-info/|
.*__pycache__/
)
pass_filenames: true
- id: log-quality-basic
name: log quality basic check
entry: pre-commit/check_log_quality.py --incremental
language: python
types: [python]
files: ^motor/
exclude: ^motor/.*/tests/
pass_filenames: true
- repo: local
hooks:
- id: gitleaks-offline-scan
name: Gitleaks Secret Scan(Local Binary)
entry: ./gitleaks
language: system
pass_filenames: true
args:
- protect
- --verbose
- --redact
- --config=pre-commit/.gitleaks.toml
stages: [pre-commit]