TensorRT-LLMs/.pre-commit-config.yaml
2ez4bz dc52b67492
linting(python): Enable ruff on more files (wave 1/N) (#5140)
Signed-off-by: William Zhang <133824995+2ez4bz@users.noreply.github.com>
2025-06-14 19:19:34 +08:00

91 lines
2.6 KiB
YAML

default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
rev: v1.5.5
hooks:
- id: remove-crlf
- repo: https://github.com/google/yapf
rev: v0.43.0
hooks:
- id: yapf
exclude: ".*/auto_deploy/.*"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-added-large-files
exclude: |
(?x)^(.*cubin.cpp | .*cubin.h)$
- id: check-merge-conflict
- id: check-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ".*/gitlab/.*.yml"
- id: trailing-whitespace
- id: check-toml
- id: mixed-line-ending
args: [--fix=lf]
files: ".*/auto_deploy/.*"
- id: debug-statements
files: ".*/auto_deploy/.*"
- id: check-json
files: ".*/auto_deploy/.*"
exclude: >
(?x)^(
.*\.vscode/.*\.json | # vscode files can take comments
.*\.devcontainer/.*\.json # devcontainer json files can take comments
)$
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
additional_dependencies:
- tomli
args: ['--config', 'pyproject.toml']
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.0
hooks:
- id: clang-format
types_or: [c++, c, cuda]
exclude: |
(?x)^(.*cubin.cpp$ | .*_cubin.h)$
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.10
hooks:
- id: cmake-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
# add ignore words list
args: ["-L", "Mor,ans,thirdparty"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
pass_filenames: false
- id: ruff-format
pass_filenames: false
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat_frontmatter
files: ".*/auto_deploy/.*"
- repo: local
hooks:
- id: DCO check
name: Checks the commit message for a developer certificate of origin signature
entry: ./scripts/dco_check.py
language: script
stages: [commit-msg]