-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
74 lines (73 loc) · 3.4 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
74 lines (73 loc) · 3.4 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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
hooks:
# Run the linter
- id: ruff
args: ["--fix"]
# Run the formatter
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-symlinks
- id: destroyed-symlinks
- id: check-added-large-files
args: ["--maxkb=2000"] # restrict files more than 2 MB. Should use git-lfs instead.
- id: check-yaml
- id: check-merge-conflict
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-toml
- id: end-of-file-fixer
# This LFS SVG is an asset; rewriting its final byte creates a new LFS object.
exclude: ^docs/source/_static/camera-viz-controls\.svg$
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: debug-statements
# SPDX license headers (REUSE): require SPDX-FileCopyrightText and SPDX-License-Identifier
- repo: https://github.com/fsfe/reuse-tool
rev: v6.2.0
hooks:
- id: reuse-lint-file
name: REUSE lint (SPDX headers on changed files)
# Include CMakeLists.txt and Dockerfile.xxx by matching those explicitly in the regex
files: \.(py|js|ts|cpp|c|h|hpp|cxx|hxx|cmake|md|yaml|yml|sh|fbs|toml|html)$|CMakeLists\.txt$|Dockerfile(\.[A-Za-z0-9_-]+)?$
# Copyright year: ensure SPDX-FileCopyrightText includes current year (--fix updates in place)
- repo: local
hooks:
- id: check-dco-signoff
name: Require DCO Signed-off-by in commit message
entry: python3 scripts/check_dco_signoff.py
language: system
stages: [commit-msg]
- id: check-copyright-year
name: Check copyright year (include current year)
entry: python3 scripts/check_copyright_year.py --fix
language: system
# Include CMakeLists.txt and Dockerfile.xxx by matching those explicitly in the regex
files: \.(py|js|ts|cpp|c|h|hpp|cxx|hxx|cmake|md|yaml|yml|sh|fbs|toml|html)$|CMakeLists\.txt$|Dockerfile(\.[A-Za-z0-9_-]+)?$
- id: check-lfs-pointers
name: Ensure Git LFS-marked files are LFS pointers
entry: python3 scripts/check_lfs_pointers.py
language: system
types: [file]
pass_filenames: true
# pre-commit stage only: in the commit-msg stage pre-commit passes the
# COMMIT_EDITMSG path (outside the work tree), which makes the script's
# `git check-attr` fail with "outside repository" (exit 128).
stages: [pre-commit]
- id: check-doc-refs
name: "Check docs do not reference code that is not there"
entry: python3 scripts/check_doc_refs.py
language: system
# Roles: the code-file/code-dir roles in docs/source/conf.py build a
# github.com URL from the target without validating it, so a moved file
# ships a live 404 while the Sphinx build still passes. .rst only.
# Imports: documented isaaccapture.* imports must resolve under
# src/python/, so a package rename cannot leave copy-pasteable examples
# that raise ModuleNotFoundError. .rst and .md both carry those.
files: ^(docs/source/.*\.rst|(?!.*/(build|_build|\.venv|node_modules)/).*\.md)$