forked from InsightSoftwareConsortium/ITK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
128 lines (127 loc) · 4.82 KB
/
.pre-commit-config.yaml
File metadata and controls
128 lines (127 loc) · 4.82 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
# .pre-commit-config.yaml
# for details see https://pre-commit.com
# for list of available hooks see https://pre-commit.com/hooks.html
#
# Preclude commits that do not conform to various criteria.
#
# If a pre-commit check must be skipped then use: `SKIP=check_id git commit` Where `check_id` is the id of the check to
# be skipped such as `black`.
fail_fast: true
default_stages: [pre-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=200']
exclude: |
(
Source/DataDictionary/gdcmPrivateDefaultDicts.cxx|
Documentation/watershed.ps
)
- id: check-ast
exclude: "\\/ThirdParty\\/"
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-json
exclude: "\\/ThirdParty\\/"
- id: check-merge-conflict
exclude: "\\/ThirdParty\\/"
args: ['--assume-in-merge']
- id: check-toml
exclude: "\\/ThirdParty\\/"
- id: check-vcs-permalinks
exclude: "\\/ThirdParty\\/"
- id: check-xml
exclude: "\\/ThirdParty\\/"
- id: check-yaml
exclude: "\\/ThirdParty\\/"
- id: check-shebang-scripts-are-executable
exclude: "\\/ThirdParty\\/"
- id: debug-statements
exclude: "\\/ThirdParty\\/"
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: "\\.(md5|sha|sha512|svg|vtk|vtp)$|^Resources\\/[^\\/]+\\.h$|\\/ColorFiles\\/.+\\.txt$|Data\\/Input\\/.+$|\\/ThirdParty\\/|\\/Data\\/"
- id: forbid-new-submodules
- id: forbid-submodules
- id: mixed-line-ending
exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/"
- id: name-tests-test
exclude: "\\/ThirdParty\\/"
args: ['--pytest-test-first']
- id: no-commit-to-branch
args: ['--branch','dashboard','--branch','python-builds','--branch','release','--branch','hooks','--branch', 'main','--branch','main','--pattern','release-*']
- id: trailing-whitespace
exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/"
- repo: https://github.com/BlankSpruce/gersemi
rev: 0.19.3
hooks:
- id: gersemi
args: [ '--config', '.gersemi.config', '-i' ]
files: '.(cmake|wrap)$|CMakeLists.txt'
exclude: "\\/ThirdParty\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+\\/|Modules\\/Remote\\/|\\/ExternalData.cmake|\\/.pixi\\/|\\/cmake-build.*\\/"
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.7
hooks:
- id: clang-format
args: ['--style=file']
files: '\.(c|cc|h|cxx|hxx)$'
exclude: "\\/ThirdParty\\/|\\/Data\\/"
- repo: https://github.com/psf/black
rev: 24.2.0
hooks: # check conformance to black formatting
- id: black
#args: ['--diff', '-v', '--target-version', 'py39' ] # if run without arguments, will fail and will format the files
args: ['--target-version', 'py39' ] # Allow black to fail and provide auto-formatting to files that need it for compliance
exclude: ".*build.*|\\/ThirdParty\\/|\\/Data\\/"
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
exclude: ".*build.*|\\/ThirdParty\\/|\\/Data\\/"
args: [--py39-plus]
- repo: https://github.com/SimpleITK/CommentSpellCheck.git
rev: v0.4.4
hooks:
- id: comment-spell-check
args: ['--miss', '--dict','https://raw.githubusercontent.com/SimpleITK/SimpleITK/master/.github/workflows/additional_dictionary.txt', '--dict', '.github/workflows/itk_dict.txt', '--bibtex', 'Documentation/Doxygen/doxygen.bib', '--prefix', '\"gdcm\"', ]
exclude: |
(?x)
| /ThirdParty/ # Exclude files in subdirectories named ThirdParty/
| ^Wrapping/ # Exclude files directly under Wrapping/
| ^Utilities/ # Exclude files directly under Utilities/
| \.md$ # Exclude .md files
| \.c$ # Exclude .c files
- repo: local
hooks:
- id: local-prepare-commit-msg
name: 'local prepare-commit-msg'
entry: 'Utilities/Hooks/prepare-commit-msg'
language: system
stages: [prepare-commit-msg]
- id: check-setup-for-development
name: 'Check version of SetupForDevelopment'
entry: 'Utilities/Hooks/check-setup-for-development'
language: system
pass_filenames: false
stages: [pre-commit]
- id: local-pre-commit
name: 'local pre-commit'
entry: 'Utilities/Hooks/pre-commit'
language: system
pass_filenames: false
stages: [pre-commit]
- id: kw-commit-msg
name: 'kw commit-msg'
entry: 'Utilities/Hooks/run-pixi-python.sh Utilities/Hooks/kw-commit-msg.py'
language: system
stages: [commit-msg]
exclude: "\\/ThirdParty\\/"
- id: kw-pre-commit
name: 'kw-pre-commit'
entry: 'Utilities/Hooks/kw-pre-commit'
language: system
pass_filenames: false
stages: [pre-commit]