Skip to content

Commit 290abfc

Browse files
committed
COMP: Add ITK-style pre-commit configuration
Standard hygiene hooks plus clang-format v19.1.7 (must track ITK main's pin; the lint CI job resolves it from ITK at run time), black, and pyupgrade for Python.
1 parent e50d294 commit 290abfc

24 files changed

Lines changed: 53 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Mirrors ITK's .pre-commit-config.yaml style gates for C++ and Python.
2+
# The clang-format rev must track ITK main's pin (the lint CI job
3+
# resolves its version from ITK main at run time).
4+
fail_fast: true
5+
default_stages: [pre-commit]
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: check-added-large-files
11+
args: ['--maxkb=200']
12+
- id: check-ast
13+
- id: check-case-conflict
14+
- id: check-illegal-windows-names
15+
- id: check-json
16+
exclude: "\\.ipynb$"
17+
- id: check-merge-conflict
18+
- id: check-toml
19+
- id: check-vcs-permalinks
20+
- id: check-xml
21+
- id: check-yaml
22+
- id: check-shebang-scripts-are-executable
23+
- id: debug-statements
24+
exclude: "^Utilities\\/SphinxExtensions\\/"
25+
- id: destroyed-symlinks
26+
- id: detect-private-key
27+
- id: end-of-file-fixer
28+
exclude: "\\.(md5|sha512|cid|svg|vtk|vtp|ipynb)$|^Superbuild\\/"
29+
- id: forbid-new-submodules
30+
- id: mixed-line-ending
31+
exclude: "\\.(sha512|cid|svg|vtk|vtp|ipynb)$"
32+
- id: no-commit-to-branch
33+
args: ['--branch','main','--branch','dashboard','--branch','gh-pages']
34+
- id: trailing-whitespace
35+
exclude: "\\.(sha512|cid|svg|vtk|vtp|ipynb)$"
36+
- repo: https://github.com/pre-commit/mirrors-clang-format
37+
rev: v19.1.7
38+
hooks:
39+
- id: clang-format
40+
args: ['--style=file']
41+
files: '\.(c|cc|h|cxx|hxx)$'
42+
- repo: https://github.com/psf/black
43+
rev: 25.12.0
44+
hooks:
45+
- id: black
46+
args: ['--target-version', 'py310']
47+
exclude: "^Utilities\\/SphinxExtensions\\/"
48+
- repo: https://github.com/asottile/pyupgrade
49+
rev: v3.21.2
50+
hooks:
51+
- id: pyupgrade
52+
args: [--py310-plus]
53+
exclude: "^Utilities\\/SphinxExtensions\\/"

Utilities/CookieCutter/hooks/post_gen_project.py

100644100755
File mode changed.

src/Core/Common/EagerModuleLoadingPython/Code.py

100644100755
File mode changed.

src/Core/Common/PrintModuleLoadingPython/Code.py

100644100755
File mode changed.

src/Core/Common/VectorDotProduct/Code.py

100644100755
File mode changed.

src/Core/Mesh/AddPointsAndEdges/Code.py

100644100755
File mode changed.

src/Core/Transform/ScaleAnImage/Code.py

100644100755
File mode changed.

src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.py

100644100755
File mode changed.

src/Filtering/FFT/ComputeFFTInOneDimension/Code.py

100644100755
File mode changed.

src/Filtering/FFT/ComputeInverseFFTOfImage/Code.py

100644100755
File mode changed.

0 commit comments

Comments
 (0)