Skip to content

Commit 558c5c9

Browse files
committed
STYLE: Update clang-format to match ITK 2025-11-10
Update to match clang-format-19 from ITK Set the default build package tags to v5.4.4 for capturing the ITKRemoteModuleBuildTestPackageAction shared scripts. This pulls the default configuration items needed to build against ITK version v5.4.4. Update pyproject.toml for ITK 5.4.4 Ensure that cmake is 3.16.3 or greater to match v5.4.4 minimum requirements. Increment version number. Replace keyword of "ITK" with lowercase "itk" in some instances to be consistent. Update RemoteModulePackageAction and Python 3.9+ Update github actions to v5.4.4 and package management for python 3.9
1 parent 0c1b1b5 commit 558c5c9

File tree

7 files changed

+222
-55
lines changed

7 files changed

+222
-55
lines changed

.clang-format

Lines changed: 210 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## This config file is only relevant for clang-format version 8.0.0
1+
## This config file is only relevant for clang-format version 19.1.7
22
##
33
## Examples of each format style can be found on the in the clang-format documentation
44
## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option
@@ -10,142 +10,310 @@
1010
## maintaining a consistent code style.
1111
##
1212
## EXAMPLE apply code style enforcement before commit:
13-
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified
13+
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.7} --modified
1414
## EXAMPLE apply code style enforcement after commit:
15-
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last
15+
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.7} --last
1616
---
17-
# This configuration requires clang-format version 8.0.0 exactly.
18-
BasedOnStyle: Mozilla
17+
# This configuration requires clang-format version 19.1.7 exactly.
1918
Language: Cpp
2019
AccessModifierOffset: -2
2120
AlignAfterOpenBracket: Align
22-
AlignConsecutiveAssignments: false
23-
AlignConsecutiveDeclarations: true
24-
AlignEscapedNewlines: Right
25-
AlignOperands: true
26-
AlignTrailingComments: true
27-
# clang 9.0 AllowAllArgumentsOnNextLine: true
28-
# clang 9.0 AllowAllConstructorInitializersOnNextLine: true
21+
AlignArrayOfStructures: None
22+
AlignConsecutiveAssignments:
23+
Enabled: false
24+
AcrossEmptyLines: false
25+
AcrossComments: false
26+
AlignCompound: false
27+
AlignFunctionPointers: false
28+
PadOperators: true
29+
AlignConsecutiveBitFields:
30+
Enabled: false
31+
AcrossEmptyLines: false
32+
AcrossComments: false
33+
AlignCompound: false
34+
AlignFunctionPointers: false
35+
PadOperators: false
36+
AlignConsecutiveDeclarations:
37+
Enabled: true
38+
AcrossEmptyLines: false
39+
AcrossComments: false
40+
AlignCompound: false
41+
AlignFunctionPointers: false
42+
PadOperators: true
43+
AlignConsecutiveMacros:
44+
Enabled: false
45+
AcrossEmptyLines: false
46+
AcrossComments: false
47+
AlignCompound: false
48+
AlignFunctionPointers: false
49+
PadOperators: false
50+
AlignConsecutiveShortCaseStatements:
51+
Enabled: false
52+
AcrossEmptyLines: false
53+
AcrossComments: false
54+
AlignCaseArrows: false
55+
AlignCaseColons: false
56+
AlignConsecutiveTableGenBreakingDAGArgColons:
57+
Enabled: false
58+
AcrossEmptyLines: false
59+
AcrossComments: false
60+
AlignCompound: false
61+
AlignFunctionPointers: false
62+
PadOperators: false
63+
AlignConsecutiveTableGenCondOperatorColons:
64+
Enabled: false
65+
AcrossEmptyLines: false
66+
AcrossComments: false
67+
AlignCompound: false
68+
AlignFunctionPointers: false
69+
PadOperators: false
70+
AlignConsecutiveTableGenDefinitionColons:
71+
Enabled: false
72+
AcrossEmptyLines: false
73+
AcrossComments: false
74+
AlignCompound: false
75+
AlignFunctionPointers: false
76+
PadOperators: false
77+
AlignEscapedNewlines: Left
78+
AlignOperands: Align
79+
AlignTrailingComments:
80+
Kind: Always
81+
OverEmptyLines: 0
82+
AllowAllArgumentsOnNextLine: true
2983
AllowAllParametersOfDeclarationOnNextLine: false
30-
AllowShortBlocksOnASingleLine: false
84+
AllowBreakBeforeNoexceptSpecifier: Never
85+
AllowShortBlocksOnASingleLine: Never
86+
AllowShortCaseExpressionOnASingleLine: true
3187
AllowShortCaseLabelsOnASingleLine: false
32-
AllowShortFunctionsOnASingleLine: Inline
33-
# clang 9.0 AllowShortLambdasOnASingleLine: All
34-
# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never
35-
AllowShortIfStatementsOnASingleLine: false
88+
AllowShortCompoundRequirementOnASingleLine: true
89+
AllowShortEnumsOnASingleLine: true
90+
#AllowShortFunctionsOnASingleLine: Inline Only merge functions defined inside a class. Implies empty.
91+
#AllowShortFunctionsOnASingleLine: None (in configuration: None) Never merge functions into a single line.
92+
AllowShortFunctionsOnASingleLine: All
93+
AllowShortIfStatementsOnASingleLine: Never
94+
AllowShortLambdasOnASingleLine: All
3695
AllowShortLoopsOnASingleLine: false
3796
AlwaysBreakAfterDefinitionReturnType: None
38-
AlwaysBreakAfterReturnType: All
3997
AlwaysBreakBeforeMultilineStrings: false
40-
AlwaysBreakTemplateDeclarations: Yes
98+
AttributeMacros:
99+
- __capability
41100
BinPackArguments: false
42101
BinPackParameters: false
43-
BreakBeforeBraces: Custom
102+
BitFieldColonSpacing: Both
44103
BraceWrapping:
45-
# clang 9.0 feature AfterCaseLabel: false
104+
AfterCaseLabel: true
46105
AfterClass: true
47-
AfterControlStatement: true
106+
AfterControlStatement: Always
48107
AfterEnum: true
108+
AfterExternBlock: true
49109
AfterFunction: true
50110
AfterNamespace: true
51111
AfterObjCDeclaration: true
52112
AfterStruct: true
53113
AfterUnion: true
54-
AfterExternBlock: true
55114
BeforeCatch: true
56115
BeforeElse: true
57-
## This is the big change from historical ITK formatting!
58-
# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style
59-
# with indented braces, and not indented code. This style is very difficult to automatically
60-
# maintain with code beautification tools. Not indenting braces is more common among
61-
# formatting tools.
116+
BeforeLambdaBody: false
117+
BeforeWhile: false
62118
IndentBraces: false
63119
SplitEmptyFunction: false
64120
SplitEmptyRecord: false
65121
SplitEmptyNamespace: false
122+
BreakAdjacentStringLiterals: true
123+
BreakAfterAttributes: Leave
124+
BreakAfterJavaFieldAnnotations: false
125+
BreakAfterReturnType: All
126+
BreakArrays: true
66127
BreakBeforeBinaryOperators: None
67-
#clang 6.0 BreakBeforeInheritanceComma: true
68-
BreakInheritanceList: BeforeComma
128+
BreakBeforeConceptDeclarations: Always
129+
BreakBeforeBraces: Custom
130+
BreakBeforeInlineASMColon: OnlyMultiline
69131
BreakBeforeTernaryOperators: true
70-
#clang 6.0 BreakConstructorInitializersBeforeComma: true
71132
BreakConstructorInitializers: BeforeComma
72-
BreakAfterJavaFieldAnnotations: false
133+
BreakFunctionDefinitionParameters: false
134+
BreakInheritanceList: BeforeComma
73135
BreakStringLiterals: true
136+
BreakTemplateDeclarations: Yes
74137
## The following line allows larger lines in non-documentation code
75138
ColumnLimit: 120
76139
CommentPragmas: '^ IWYU pragma:'
77140
CompactNamespaces: false
78-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
79141
ConstructorInitializerIndentWidth: 2
80142
ContinuationIndentWidth: 2
81143
Cpp11BracedListStyle: false
82144
DerivePointerAlignment: false
83145
DisableFormat: false
146+
EmptyLineAfterAccessModifier: Never
147+
EmptyLineBeforeAccessModifier: LogicalBlock
84148
ExperimentalAutoDetectBinPacking: false
85149
FixNamespaceComments: true
86150
ForEachMacros:
87151
- foreach
88152
- Q_FOREACH
89153
- BOOST_FOREACH
154+
IfMacros:
155+
- KJ_IF_MAYBE
90156
IncludeBlocks: Preserve
91157
IncludeCategories:
92158
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
93159
Priority: 2
160+
SortPriority: 0
161+
CaseSensitive: false
94162
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
95163
Priority: 3
164+
SortPriority: 0
165+
CaseSensitive: false
96166
- Regex: '.*'
97167
Priority: 1
168+
SortPriority: 0
169+
CaseSensitive: false
98170
IncludeIsMainRegex: '(Test)?$'
171+
IncludeIsMainSourceRegex: ''
172+
IndentAccessModifiers: false
173+
IndentCaseBlocks: false
99174
IndentCaseLabels: true
175+
IndentExternBlock: AfterExternBlock
176+
IndentGotoLabels: true
100177
IndentPPDirectives: AfterHash
178+
IndentRequiresClause: true
101179
IndentWidth: 2
102180
IndentWrappedFunctionNames: false
181+
InsertBraces: false
182+
InsertNewlineAtEOF: false
183+
InsertTrailingCommas: None
184+
IntegerLiteralSeparator:
185+
Binary: 0
186+
BinaryMinDigits: 0
187+
Decimal: 0
188+
DecimalMinDigits: 0
189+
Hex: 0
190+
HexMinDigits: 0
103191
JavaScriptQuotes: Leave
104192
JavaScriptWrapImports: true
105-
KeepEmptyLinesAtTheStartOfBlocks: true
193+
KeepEmptyLines:
194+
AtEndOfFile: false
195+
AtStartOfBlock: true
196+
AtStartOfFile: true
197+
LambdaBodyIndentation: Signature
198+
LineEnding: DeriveLF
106199
MacroBlockBegin: ''
107200
MacroBlockEnd: ''
201+
MainIncludeChar: Quote
108202
MaxEmptyLinesToKeep: 2
109203
NamespaceIndentation: None
110204
ObjCBinPackProtocolList: Auto
111205
ObjCBlockIndentWidth: 2
206+
ObjCBreakBeforeNestedBlockParam: true
112207
ObjCSpaceAfterProperty: true
113208
ObjCSpaceBeforeProtocolList: false
209+
PackConstructorInitializers: BinPack
114210
PenaltyBreakAssignment: 2
115211
PenaltyBreakBeforeFirstCallParameter: 19
116212
PenaltyBreakComment: 300
117213
## The following line allows larger lines in non-documentation code
118214
PenaltyBreakFirstLessLess: 120
215+
PenaltyBreakOpenParenthesis: 0
216+
PenaltyBreakScopeResolution: 500
119217
PenaltyBreakString: 1000
120218
PenaltyBreakTemplateDeclaration: 10
121219
PenaltyExcessCharacter: 1000000
220+
PenaltyIndentedWhitespace: 0
122221
PenaltyReturnTypeOnItsOwnLine: 200
123222
PointerAlignment: Middle
223+
PPIndentWidth: -1
224+
QualifierAlignment: Custom
225+
QualifierOrder:
226+
- friend
227+
- static
228+
- inline
229+
- constexpr
230+
- const
231+
- type
232+
ReferenceAlignment: Pointer
124233
ReflowComments: true
234+
RemoveBracesLLVM: false
235+
RemoveParentheses: Leave
236+
RemoveSemicolon: false
237+
RequiresClausePosition: OwnLine
238+
RequiresExpressionIndentation: OuterScope
239+
SeparateDefinitionBlocks: Leave
240+
ShortNamespaceLines: 1
241+
SkipMacroDefinitionBody: false
125242
# We may want to sort the includes as a separate pass
126-
SortIncludes: false
243+
SortIncludes: Never
244+
SortJavaStaticImport: Before
127245
# We may want to revisit this later
128-
SortUsingDeclarations: false
246+
SortUsingDeclarations: Never
129247
SpaceAfterCStyleCast: false
130-
# SpaceAfterLogicalNot: false
248+
SpaceAfterLogicalNot: false
131249
SpaceAfterTemplateKeyword: true
250+
SpaceAroundPointerQualifiers: Default
132251
SpaceBeforeAssignmentOperators: true
252+
SpaceBeforeCaseColon: false
133253
SpaceBeforeCpp11BracedList: false
134254
SpaceBeforeCtorInitializerColon: true
135255
SpaceBeforeInheritanceColon: true
256+
SpaceBeforeJsonColon: false
136257
SpaceBeforeParens: ControlStatements
258+
SpaceBeforeParensOptions:
259+
AfterControlStatements: true
260+
AfterForeachMacros: true
261+
AfterFunctionDefinitionName: false
262+
AfterFunctionDeclarationName: false
263+
AfterIfMacros: true
264+
AfterOverloadedOperator: false
265+
AfterPlacementOperator: true
266+
AfterRequiresInClause: false
267+
AfterRequiresInExpression: false
268+
BeforeNonEmptyParentheses: false
137269
SpaceBeforeRangeBasedForLoopColon: true
138-
SpaceInEmptyParentheses: false
270+
SpaceBeforeSquareBrackets: false
271+
SpaceInEmptyBlock: false
139272
SpacesBeforeTrailingComments: 1
140-
SpacesInAngles: false
273+
SpacesInAngles: Never
141274
SpacesInContainerLiterals: false
142-
SpacesInCStyleCastParentheses: false
143-
SpacesInParentheses: false
275+
SpacesInLineCommentPrefix:
276+
Minimum: 1
277+
Maximum: -1
278+
SpacesInParens: Never
279+
SpacesInParensOptions:
280+
ExceptDoubleParentheses: false
281+
InCStyleCasts: false
282+
InConditionalStatements: false
283+
InEmptyParentheses: false
284+
Other: false
144285
SpacesInSquareBrackets: false
145-
Standard: Cpp11
286+
Standard: Latest
287+
StatementAttributeLikeMacros:
288+
- Q_EMIT
146289
StatementMacros:
147290
- Q_UNUSED
148291
- QT_REQUIRE_VERSION
292+
- ITK_GCC_PRAGMA_PUSH
293+
- ITK_GCC_PRAGMA_POP
294+
- ITK_GCC_SUPPRESS_Wfloat_equal
295+
- ITK_GCC_SUPPRESS_Wformat_nonliteral
296+
- ITK_GCC_SUPPRESS_Warray_bounds
297+
- ITK_CLANG_PRAGMA_PUSH
298+
- ITK_CLANG_PRAGMA_POP
299+
- ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant
300+
- ITK_CLANG_SUPPRESS_Wduplicate_enum
301+
- CLANG_PRAGMA_PUSH
302+
- CLANG_PRAGMA_POP
303+
- CLANG_SUPPRESS_Wfloat_equal
304+
- INTEL_PRAGMA_WARN_PUSH
305+
- INTEL_PRAGMA_WARN_POP
306+
- INTEL_SUPPRESS_warning_1292
307+
- itkTemplateFloatingToIntegerMacro
308+
- itkLegacyMacro
309+
TableGenBreakInsideDAGArg: DontBreak
149310
TabWidth: 2
150311
UseTab: Never
312+
VerilogBreakBetweenInstancePorts: true
313+
WhitespaceSensitiveMacros:
314+
- BOOST_PP_STRINGIZE
315+
- CF_SWIFT_NAME
316+
- NS_SWIFT_NAME
317+
- PP_STRINGIZE
318+
- STRINGIZE
151319
...

.github/workflows/build-test-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on: [push,pull_request]
55

66
jobs:
77
cxx-build-workflow:
8-
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.0
8+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.4
99

1010
python-build-workflow:
11-
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.0
11+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.4
1212
with:
1313
test-notebooks: false
1414
secrets:

.github/workflows/clang-format-linter.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v5
11+
12+
- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@main
1113
with:
12-
fetch-depth: 1
13-
- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master
14+
itk-branch: main

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.10.2)
1+
cmake_minimum_required(VERSION 3.16.3)
22
project(TwoProjectionRegistration)
33

44
if(NOT ITK_SOURCE_DIR)

include/itkTwoImageToOneImageMetric.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ class TwoImageToOneImageMetric : public SingleValuedCostFunction
8181
static constexpr unsigned int FixedImageDimension = TFixedImage::ImageDimension;
8282

8383
/** Type of the Transform Base class */
84-
using TransformType = Transform<CoordinateRepresentationType,
85-
Self::MovingImageDimension,
86-
Self::FixedImageDimension>;
84+
using TransformType = Transform<CoordinateRepresentationType, Self::MovingImageDimension, Self::FixedImageDimension>;
8785

8886
using TransformPointer = typename TransformType::Pointer;
8987
using InputPointType = typename TransformType::InputPointType;

0 commit comments

Comments
 (0)