Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
163 lines (147 loc) · 5.14 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
163 lines (147 loc) · 5.14 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright (c) 2024, NVIDIA CORPORATION.
ci:
autofix_commit_msg: |
[pre-commit.ci] auto code formatting
autofix_prs: false
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: quarterly
skip: [secret-scan-trufflehog, guardwords-scan-code-scanning]
submodules: false
# Generated and signed by NVSkills CI. Any change to these files invalidates
# the skill signature, so no hook may rewrite them.
exclude: ^skills/[^/]+/(skill\.oms\.sig|skill-card\.md|BENCHMARK\.md)$
repos:
# Runs first so a leaked credential blocks the commit before any formatter runs.
# Self-installing: the hook downloads a pinned, checksum-verified trufflehog on
# first use (no manual install). Skipped on pre-commit.ci; Pulse CI enforces server-side.
# GuardWords needs NVIDIA's internal client and network; it skips with a notice elsewhere.
- repo: https://github.com/NVIDIA/security-workflows
rev: d8189f3176942de7ffe2c48bcd7bb5fbdee2dd15 # frozen: v0.6.0
hooks:
- id: secret-scan-trufflehog
- id: guardwords-scan-code-scanning
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
# handled by clang-format
exclude_types: [c, c++, cuda]
- id: check-json
- id: check-toml
- id: pretty-format-json
args: ['--autofix', '--indent=2', '--no-sort-keys']
- id: check-symlinks
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
# ruff checks this already
exclude_types: [python]
- id: check-yaml
# Switch to upstream rhysd/actionlint once it supports the $/ self-repository syntax.
- repo: https://github.com/chuckatkins/actionlint
rev: fd81d12
hooks:
- id: actionlint
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
exclude: |
(?x)^(
^.*libcudacxx/cmake/config\.guess$
)
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v22.1.5
hooks:
- id: clang-format
types_or: [file]
files: |
(?x)^(
^.*\.c$|
^.*\.cpp$|
^.*\.cu$|
^.*\.cuh$|
^.*\.cxx$|
^.*\.h$|
^.*\.hpp$|
^.*\.inl$|
^.*\.mm$|
^libcudacxx/include/.*/[^.]*$
)
args: ["-fallback-style=none", "-style=file", "-i"]
# TODO/REMINDER: add the Ruff vscode extension to the devcontainers
# Ruff, the Python auto-correcting linter/formatter written in Rust
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
hooks:
- id: ruff # linter
- id: ruff-format # formatter
# CMake formatting
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.23.1
hooks:
- id: gersemi
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml", "-I", ".codespell-ignore.txt"]
exclude: |
(?x)^(
build|
CITATION.md
)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v2.1.0'
hooks:
- id: mypy
# numpy is intentionally not installed here: numpy>=2.3 ships PEP 695
# `type` statements in its stubs that mypy rejects under
# python_version=3.10, and numpy<2.3 has no wheels for the Python that
# pre-commit.ci runs. numpy is instead ignored in the mypy config.
additional_dependencies: [types-cachetools]
args: ["--config-file=python/cuda_cccl/pyproject.toml",
"python/cuda_cccl/cuda/compute/",
"benchmarks/scripts/"]
pass_filenames: false
- repo: https://github.com/sirosen/texthooks
rev: 0.7.1
hooks:
- id: fix-smartquotes
- id: fix-spaces
- id: forbid-bidi-controls
- id: fix-ligatures
- repo: local
hooks:
- id: check-shebang
name: check-shebang
entry: ci/util/pre-commit/check_shebang.py
language: python
types: [shell]
exclude: |
(?x)^(
^.*libcudacxx/cmake/config\.guess$
)
- id: check-cub-test-macros
name: require CUB test memory classification
entry: ci/util/pre-commit/check_cub_test_macros.py
language: python
files: ^(cub/test/.*\.(cu|cuh|h)|ci/util/pre-commit/check_cub_test_macros\.py)$
types: [file]
- id: check-ptx-umbrella
name: require <cuda/ptx> to export every PTX instruction header
entry: ci/util/pre-commit/check_ptx_umbrella.py
language: python
pass_filenames: false
files: ^(libcudacxx/include/cuda/(ptx|ptxs/.*|__ptx/.*)|ci/util/pre-commit/check_ptx_umbrella\.py)$
- id: unprintable-unicode
name: unprintable-unicode
entry: ci/util/pre-commit/strip_unprintable.py
language: python
types: [text]
default_language_version:
python: python3