Skip to content

Commit ab760e4

Browse files
committed
ci: keep triton_cli's Ruff/pyupgrade toolchain
Review feedback on #127: the swap to isort/black/flake8 was not intentional - this repository's Ruff formatter/linter and pyupgrade setup is deliberate and stays. Only the shared alignment additions apply: commit-msg conventional-commit validation and default_install_hook_types. TRI-1100
1 parent 858a1a5 commit ab760e4

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

.pre-commit-config.yaml

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,38 @@
2727
default_install_hook_types: [pre-commit, commit-msg]
2828

2929
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
3735
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
4242
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
4849
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
5254
- repo: https://github.com/codespell-project/codespell
5355
rev: v2.2.4
5456
hooks:
5557
- id: codespell
5658
additional_dependencies: [tomli]
5759
args: ["--toml", "pyproject.toml"]
5860
exclude: (?x)^(.*stemmer.*|.*stop_words.*|^CHANGELOG.md$)
61+
5962
# Validates commit messages against the Conventional Commits format
6063
# (<commit_type>: <title>); PR titles are validated org-wide by the
6164
# conventional-pr reusable workflow.
@@ -76,6 +79,7 @@ repos:
7679
- id: check-json
7780
- id: check-toml
7881
- id: check-yaml
82+
exclude: ^deploy(\/[^\/]+)*\/templates\/.*$
7983
- id: check-shebang-scripts-are-executable
8084
- id: end-of-file-fixer
8185
types_or: [c, c++, cuda, proto, textproto, java, python]

0 commit comments

Comments
 (0)