forked from triton-lang/triton
-
Notifications
You must be signed in to change notification settings - Fork 29
/
.pre-commit-config.yaml
73 lines (68 loc) · 2.1 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
default_stages: [pre-commit, pre-push, manual]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-symlinks
- id: destroyed-symlinks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-ast
- id: check-added-large-files
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.1
hooks:
- id: ruff
files: '^python/.*'
args: ["--fix", "--exit-non-zero-on-fix"]
exclude: |
(?x)(
^python/triton/runtime/.*|
^test/|
^docs/conf.py$
)
- repo: https://github.com/google/yapf
rev: "7e21823"
hooks:
- id: yapf
args: ["-p", "-i"]
exclude: "python/test/unit/language/test_line_info.py"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.2
hooks:
- id: clang-format
# Expand YAML anchors in files used by github workflows, because github can't
# do this itself. This lets us use anchors, which avoids code duplication.
- repo: local
hooks:
- id: expand-yaml-anchors
name: Expand YAML anchors
language: golang
additional_dependencies: [github.com/mikefarah/yq/v4@latest]
entry: >
bash -c '
OUT=".github/workflows/integration-tests.yml"
IN="$OUT.in"
echo "# AUTOGENERATED by pre-commit, modify the .in file instead." > "$OUT" &&
echo >> "$OUT"
yq "explode(.)" "$IN" >> "$OUT"
'
files: ^.github/workflows/integration-tests.yml.*
pass_filenames: false
exclude: |
(?x)(
^include/triton/external/|
^third_party/amd/backend/include/hip/|
^third_party/amd/backend/include/hsa/|
^third_party/amd/backend/include/roctracer/|
^third_party/amd/backend/lib/|
^third_party/nvidia/backend/include/cuda.h|
^third_party/f2reduce
)