|
27 | 27 | default_install_hook_types: [pre-commit, commit-msg] |
28 | 28 |
|
29 | 29 | repos: |
30 | | -- repo: https://github.com/PyCQA/isort |
31 | | - rev: 5.12.0 |
32 | | - hooks: |
33 | | - - id: isort |
34 | | - additional_dependencies: [toml] |
35 | | -- repo: https://github.com/psf/black |
36 | | - rev: 23.1.0 |
| 30 | + |
| 31 | +# Python formatting/linting |
| 32 | +## Run the Ruff formatter. |
| 33 | +- repo: https://github.com/astral-sh/ruff-pre-commit |
| 34 | + rev: v0.5.2 |
37 | 35 | hooks: |
38 | | - - id: black |
39 | | - types_or: [python, cython] |
40 | | -- repo: https://github.com/PyCQA/flake8 |
41 | | - rev: 7.3.0 |
| 36 | + - id: ruff-format |
| 37 | + exclude: "src/triton_cli/trt_llm/checkpoint_scripts|src/triton_cli/templates/trt_llm" |
| 38 | + |
| 39 | +## Run the Ruff linter. |
| 40 | +- repo: https://github.com/astral-sh/ruff-pre-commit |
| 41 | + rev: v0.5.2 |
42 | 42 | hooks: |
43 | | - - id: flake8 |
44 | | - args: [--max-line-length=88, --select=C,E,F,W,B,B950, --extend-ignore = E203,E501] |
45 | | - types_or: [python, cython] |
46 | | -- repo: https://github.com/pre-commit/mirrors-clang-format |
47 | | - rev: v16.0.5 |
| 43 | + - id: ruff |
| 44 | + exclude: "src/triton_cli/trt_llm/checkpoint_scripts|src/triton_cli/templates/trt_llm" |
| 45 | + |
| 46 | +# Upgrade Python syntax |
| 47 | +- repo: https://github.com/asottile/pyupgrade |
| 48 | + rev: v3.15.0 |
48 | 49 | hooks: |
49 | | - - id: clang-format |
50 | | - types_or: [c, c++, cuda, proto, textproto, java] |
51 | | - args: ["-fallback-style=none", "-style=file", "-i"] |
| 50 | + - id: pyupgrade |
| 51 | + args: [--py38-plus] |
| 52 | + |
| 53 | +# Spellchecking |
52 | 54 | - repo: https://github.com/codespell-project/codespell |
53 | 55 | rev: v2.2.4 |
54 | 56 | hooks: |
55 | 57 | - id: codespell |
56 | 58 | additional_dependencies: [tomli] |
57 | 59 | args: ["--toml", "pyproject.toml"] |
58 | 60 | exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$) |
| 61 | + |
59 | 62 | # Validates commit messages against the Conventional Commits format |
60 | 63 | # (<commit_type>: <title>); PR titles are validated org-wide by the |
61 | 64 | # conventional-pr reusable workflow. |
|
76 | 79 | - id: check-json |
77 | 80 | - id: check-toml |
78 | 81 | - id: check-yaml |
| 82 | + exclude: ^deploy(\/[^\/]+)*\/templates\/.*$ |
79 | 83 | - id: check-shebang-scripts-are-executable |
80 | 84 | - id: end-of-file-fixer |
81 | 85 | types_or: [c, c++, cuda, proto, textproto, java, python] |
|
0 commit comments