-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
142 lines (129 loc) · 4.63 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
142 lines (129 loc) · 4.63 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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Run `pre-commit autoupdate` to refresh to latest compatible versions.
# These files are generated and covered by each skill's detached signature.
# Formatting them after signing would invalidate the published artifact.
exclude: '^skills/[^/]+/(BENCHMARK\.md|skill-card\.md|skill\.oms\.sig)$'
repos:
# General: pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-yaml
exclude: 'doc/website/mkdocs\.yml|applications/video_streaming/video_streaming_server/cpp/video_streaming_server_demo\.yaml|modules/template/\{\{cookiecutter'
- id: end-of-file-fixer
- id: mixed-line-ending
# JSON Schema: validate metadata schemas against the Draft 2020-12 meta-schema
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.38.0
hooks:
- id: check-metaschema
name: check metadata schemas against JSON Schema 2020-12 meta-schema
files: ^utilities/metadata/.*\.schema\.json$
# Python: ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.6
hooks:
- id: ruff
args: [--fix, --ignore, E712]
exclude: 'modules/template/\{\{cookiecutter'
# Python: isort
- repo: https://github.com/PyCQA/isort
rev: 9.0.1
hooks:
- id: isort
args: [--settings-path, .]
# Python: black
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.5.1
hooks:
- id: black
# Mirror pyproject.toml [tool.black] extend-exclude
exclude: |
(?x)(
^\.cache/
| ^build[^/]*/
| ^install[^/]*/
| cmake/pybind11/
| ^\.local/
| \.ipynb$
| modules/template/\{\{cookiecutter
)
# Spelling: codespell
- repo: https://github.com/codespell-project/codespell
rev: v2.4.3
hooks:
- id: codespell
args:
- --write-changes
- --ignore-words=codespell_ignore_words.txt
- --exclude-file=codespell.txt
- --skip=*.onnx,*.min.js,*.min.js.map,*/Contrastive_learning_Notebook.ipynb,./data/
# C++: cpplint
- repo: https://github.com/cpplint/cpplint
rev: 2.0.2
hooks:
- id: cpplint
args: [--quiet]
exclude: '^(applications/holoviz/template/cookiecutter|modules/template/\{\{cookiecutter)'
# Markdown: markdownlint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.49.1
hooks:
- id: markdownlint
args: [--fix, --config, .markdownlint.yaml, --ignore-path, .markdownlintignore]
- repo: local
hooks:
- id: holohub-metadata-validate
name: validate metadata.json files against schemas
entry: python3 -m utilities.metadata.metadata_validator
language: python
additional_dependencies: ["jsonschema>=4.26.0", "referencing"]
files: '(^|/)metadata\.json$'
exclude: 'modules/template/\{\{cookiecutter|^\.local/'
pass_filenames: false
- id: cmakelint
name: cmakelint
entry: cmakelint
language: python
additional_dependencies: ["cmakelint==1.4.3"]
args:
- --filter=-whitespace/indent,-linelength,-readability/wonkycase,-convention/filename,-package/stdargs
files: '(^|/)CMakeLists\.txt$|\.cmake$'
exclude: |
(?x)(
^build[^/]*/
| ^install[^/]*/
| ^data[^/]*/
| ^tmp/
| (^|/)\.[^/]+/
| modules/template/\{\{cookiecutter
)
# Copyright header check (NVIDIA SPDX)
- repo: local
hooks:
- id: check-copyright
name: check-copyright
entry: python3 .github/workflows/scripts/check_copyright.py
args:
- .
- --git-modified-only
- --exclude-config
- .github/workflows/scripts/copyright_excludes.txt
- --update-current-year
language: system
pass_filenames: false