-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (62 loc) · 1.94 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
75 lines (62 loc) · 1.94 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
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
default_install_hook_types: [pre-commit, commit-msg, pre-push]
exclude: |
(?x)(
CITATION.md|
CONTRIBUTING.md|
CODE_OF_CONDUCT.md|
design.md|
CLAUDE.md|
AGENTS.md|
CHANGELOG.md|
DCO|
LICENSE|
README.md|
SECURITY.md|
THIRD_PARTY.md
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
args:
- --assume-in-merge
- id: end-of-file-fixer
files: ".*\\.(py|sh|toml|yaml|yml|md|rst|txt)$"
- id: trailing-whitespace
files: ".*\\.(py|sh|toml|yaml|yml|md|rst|txt)$"
- repo: local
hooks:
- id: format
name: Run ruff (format + lint fix)
entry: bash tools/codestyle/format.sh
language: system
pass_filenames: true
types: [python]
- id: typecheck
name: Run ty typechecks
entry: bash tools/codestyle/typecheck.sh
language: system
pass_filenames: false
types: [python]
- id: copyright-fix
name: Fix copyright headers
entry: uv run --script tools/codestyle/copyright_fixer.py
language: system
pass_filenames: true
files: '\.(py|sh|md|yaml|yml)$'
- id: uv-lock
name: Run uv lock and check for uv.lock drift
entry: bash -c 'uv lock && git diff --exit-code uv.lock'
language: system
files: 'pyproject\.toml$'
pass_filenames: false
verbose: true
- id: check-signoff
name: Check commit is signed off (DCO)
entry: "grep -qE '^Signed-off-by: .+ <.+>'"
language: system
stages: [commit-msg]
always_run: true