-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathprek.toml
More file actions
141 lines (129 loc) · 4.55 KB
/
Copy pathprek.toml
File metadata and controls
141 lines (129 loc) · 4.55 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
# Style enforcement, run by prek (https://github.com/j178/prek) locally via git
# hooks (`prek install`) and in CI, only touch new and changed files.
#
# See docs/coding.md for the rules these tools enforce.
# `prek install` installs only the pre-commit shim by default, which would leave
# the commit-msg hook below silently uninstalled. Naming both here means a plain
# `prek install` wires up everything this config declares.
default_install_hook_types = ["pre-commit", "commit-msg"]
# Never touch vendored submodules or the CuTeDSL kernel package (the DSL
# resolves names through its own tracing machinery, so ruff reports them as
# undefined). Generated CUBIN build inputs are not excluded because they are no
# longer written into the checkout; the materializer emits them into the build
# tree.
exclude = '''(?x)^(
3rdparty/.*
| .*\.(a|lib|so|dll|a3m)
| examples/data/samples/templates/templates/.*\.cif
| bionemo_ir/dsl_kernels/cute/.*
)$'''
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.16.1"
hooks = [
{ id = "ruff-check", args = ["--fix"] },
{ id = "ruff-format" },
]
[[repos]]
# C/C++/CUDA formatting for cpp/ (handwritten kernels/bindings; see
# .clang-format). Pinned to one version so output doesn't ping-pong across
# machines.
repo = "https://github.com/pre-commit/mirrors-clang-format"
rev = "v22.1.8"
hooks = [
# .h/.hpp/.cuh are already tagged c/c++/cuda by identify, so these three
# types cover headers too (there is no "h" tag; the header tag is "header").
{ id = "clang-format", types_or = ["c", "c++", "cuda"] },
]
[[repos]]
repo = "https://github.com/rvben/rumdl-pre-commit"
rev = "v0.2.49"
hooks = [
{ id = "rumdl", args = ["--fix"] },
]
[[repos]]
repo = "https://github.com/shellcheck-py/shellcheck-py"
rev = "v0.11.0.1"
hooks = [
{ id = "shellcheck", args = ["-x"] },
]
[[repos]]
repo = "https://github.com/maxwinterstein/shfmt-py"
rev = "v4.0.0"
hooks = [
# -i 2: 2-space indent; -ci: indent switch cases; -bn: binary ops at line start.
{ id = "shfmt", args = ["-w", "-i", "2", "-ci", "-bn"] },
]
[[repos]]
repo = "https://github.com/Lucas-C/pre-commit-hooks"
rev = "v1.5.6"
hooks = [
# Full NVIDIA SPDX Apache header on all source (.license-header.txt).
# --use-current-year matches any existing header regardless of its year/range
# (so existing headers are left alone) and stamps new files with the current
# year; only inserts where missing. Two entries: `#` comment style for
# python/shell/cmake, C-block style for c/c++/cuda.
{ id = "insert-license", name = "insert license (python, shell, cmake)", types_or = [
"python",
"shell",
"cmake",
], args = [
"--license-filepath",
".license-header.txt",
"--comment-style",
"#",
"--use-current-year",
] },
{ id = "insert-license", name = "insert license (c, c++, cuda)", types_or = [
"c",
"c++",
"cuda",
], args = [
"--license-filepath",
".license-header.txt",
"--comment-style",
"/*| *| */",
"--use-current-year",
] },
]
[[repos]]
repo = "local"
# Markdown license comments belong inside YAML frontmatter. The GitHub PR and
# issue templates retain HTML comments because GitHub copies them into bodies.
[[repos.hooks]]
id = "insert-markdown-license"
name = "insert license (markdown, mdx)"
entry = "python3 scripts/insert_markdown_license.py"
language = "system"
files = '''(?i)\.mdx?$'''
exclude = '''^\.github/(PULL_REQUEST_TEMPLATE\.md|ISSUE_TEMPLATE/.*\.md)$'''
# Canonical docs checks: Fern nav coverage, link policy, public-API examples,
# and dual-target (GitHub + Fern) math style. CI's docs:check runs the same
# script and then `fern check` on the generated site; the Fern CLI step stays
# CI-only. Whole-docset, not per-file — coverage and anchor checks cannot be
# answered from the changed files alone.
[[repos.hooks]]
id = "docs-check"
name = "docs checks (fern coverage, links, math)"
entry = "python3 fern/src/check.py --no-sync"
language = "system"
pass_filenames = false
files = '''(?x)^(
bionemo_ir/.*\.py$
| docs/.*
| fern/.*
| \.agents/.*\.mdx?$
| [^/]+\.mdx?$
| \.rumdl\.toml$
)'''
[[repos]]
# Per-commit title linting (commit-msg stage): enforces the Conventional Commits
# subject via `cz check`. Config in pyproject.toml [tool.commitizen]; the same
# tool generates the changelog / bumps the version later. Local dev aid — under
# ff + squash-on the enforced gate is the MR/PR title. Runs from the commit-msg
# shim, which `default_install_hook_types` above installs.
repo = "https://github.com/commitizen-tools/commitizen"
rev = "v4.17.0"
hooks = [
{ id = "commitizen" },
]