diff --git a/.clang-format b/.clang-format index 411b009..45b9502 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,4 @@ -## This config file is only relevant for clang-format version 8.0.0 +## This config file is only relevant for clang-format version 19.1.4 ## ## Examples of each format style can be found on the in the clang-format documentation ## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option @@ -10,142 +10,309 @@ ## maintaining a consistent code style. ## ## EXAMPLE apply code style enforcement before commit: -# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.4} --modified ## EXAMPLE apply code style enforcement after commit: -# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.4} --last --- -# This configuration requires clang-format version 8.0.0 exactly. -BasedOnStyle: Mozilla +# This configuration requires clang-format version 19.1.4 exactly. Language: Cpp AccessModifierOffset: -2 AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: true -AlignEscapedNewlines: Right -AlignOperands: true -AlignTrailingComments: true -# clang 9.0 AllowAllArgumentsOnNextLine: true -# clang 9.0 AllowAllConstructorInitializersOnNextLine: true +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseArrows: false + AlignCaseColons: false +AlignConsecutiveTableGenBreakingDAGArgColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveTableGenCondOperatorColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveTableGenDefinitionColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignEscapedNewlines: Left +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: false +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Never +AllowShortCaseExpressionOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -# clang 9.0 AllowShortLambdasOnASingleLine: All -# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never -AllowShortIfStatementsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true +#AllowShortFunctionsOnASingleLine: Inline Only merge functions defined inside a class. Implies empty. +#AllowShortFunctionsOnASingleLine: None (in configuration: None) Never merge functions into a single line. +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: All AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: Yes +AttributeMacros: + - __capability BinPackArguments: false BinPackParameters: false -BreakBeforeBraces: Custom +BitFieldColonSpacing: Both BraceWrapping: - # clang 9.0 feature AfterCaseLabel: false + AfterCaseLabel: true AfterClass: true - AfterControlStatement: true + AfterControlStatement: Always AfterEnum: true + AfterExternBlock: true AfterFunction: true AfterNamespace: true AfterObjCDeclaration: true AfterStruct: true AfterUnion: true - AfterExternBlock: true BeforeCatch: true BeforeElse: true -## This is the big change from historical ITK formatting! -# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style -# with indented braces, and not indented code. This style is very difficult to automatically -# maintain with code beautification tools. Not indenting braces is more common among -# formatting tools. + BeforeLambdaBody: false + BeforeWhile: false IndentBraces: false SplitEmptyFunction: false SplitEmptyRecord: false SplitEmptyNamespace: false +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakAfterReturnType: All +BreakArrays: true BreakBeforeBinaryOperators: None -#clang 6.0 BreakBeforeInheritanceComma: true -BreakInheritanceList: BeforeComma +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Custom +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true -#clang 6.0 BreakConstructorInitializersBeforeComma: true BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false +BreakFunctionDefinitionParameters: false +BreakInheritanceList: BeforeComma BreakStringLiterals: true +BreakTemplateDeclarations: Yes ## The following line allows larger lines in non-documentation code ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE IncludeBlocks: Preserve IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 + SortPriority: 0 + CaseSensitive: false - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 + SortPriority: 0 + CaseSensitive: false - Regex: '.*' Priority: 1 + SortPriority: 0 + CaseSensitive: false IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseBlocks: false IndentCaseLabels: true +IndentExternBlock: AfterExternBlock +IndentGotoLabels: true IndentPPDirectives: AfterHash +IndentRequiresClause: true IndentWidth: 2 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false +InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLines: + AtEndOfFile: false + AtStartOfBlock: true + AtStartOfFile: true +LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' +MainIncludeChar: Quote MaxEmptyLinesToKeep: 2 NamespaceIndentation: None ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: false +PackConstructorInitializers: BinPack PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 ## The following line allows larger lines in non-documentation code PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Middle +PPIndentWidth: -1 +QualifierAlignment: Custom +QualifierOrder: + - friend + - static + - inline + - constexpr + - const + - type +ReferenceAlignment: Pointer ReflowComments: true +RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false # We may want to sort the includes as a separate pass -SortIncludes: false +SortIncludes: Never +SortJavaStaticImport: Before # We may want to revisit this later -SortUsingDeclarations: false +SortUsingDeclarations: Never SpaceAfterCStyleCast: false -# SpaceAfterLogicalNot: false +SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyParentheses: false +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: Never SpacesInContainerLiterals: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Never +SpacesInParensOptions: + ExceptDoubleParentheses: false + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false SpacesInSquareBrackets: false -Standard: Cpp11 +Standard: Latest +StatementAttributeLikeMacros: + - Q_EMIT StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION + - ITK_GCC_PRAGMA_PUSH + - ITK_GCC_PRAGMA_POP + - ITK_GCC_SUPPRESS_Wfloat_equal + - ITK_GCC_SUPPRESS_Wformat_nonliteral + - ITK_GCC_SUPPRESS_Warray_bounds + - ITK_CLANG_PRAGMA_PUSH + - ITK_CLANG_PRAGMA_POP + - ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant + - CLANG_PRAGMA_PUSH + - CLANG_PRAGMA_POP + - CLANG_SUPPRESS_Wfloat_equal + - INTEL_PRAGMA_WARN_PUSH + - INTEL_PRAGMA_WARN_POP + - INTEL_SUPPRESS_warning_1292 + - itkTemplateFloatingToIntegerMacro + - itkLegacyMacro +TableGenBreakInsideDAGArg: DontBreak TabWidth: 2 UseTab: Never +VerilogBreakBetweenInstancePorts: true +WhitespaceSensitiveMacros: + - BOOST_PP_STRINGIZE + - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE ... diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index cd35348..7c888f5 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -18,9 +18,9 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-20.04, windows-2022, macos-11] + os: [ubuntu-24.04, windows-2022, macos-14] include: - - os: ubuntu-20.04 + - os: ubuntu-24.04 c-compiler: "gcc" cxx-compiler: "g++" cmake-build-type: "MinSizeRel" @@ -28,18 +28,18 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-11 + - os: macos-14 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.9" - name: Install build dependencies run: | @@ -50,7 +50,7 @@ jobs: uses: lukka/get-cmake@v3.22.2 - name: Download OpenCL-SDK - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-14' run: | cd .. git clone --recursive https://github.com/KhronosGroup/OpenCL-SDK.git @@ -89,7 +89,7 @@ jobs: git checkout ${{ env.itk-git-tag }} - name: Build OpenCL-SDK - if: matrix.os == 'macos-11' + if: matrix.os == 'macos-14' run: | cd .. mkdir OpenCL-SDK-build @@ -213,7 +213,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: ["7", "8", "9", "10", "11"] + python-version-minor: ["9", "10", "11"] include: - c-compiler: "cl.exe" cxx-compiler: "cl.exe" @@ -223,7 +223,7 @@ jobs: - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.22.2 - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: "im" @@ -290,20 +290,20 @@ jobs: shell: cmd - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: WindowsWheel3.${{ matrix.python-version-minor }} path: ../../im/dist build-linux-opencl-python-packages: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: max-parallel: 2 matrix: python-version: ["37", "38", "39", "310", "311"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: 'Free up disk space' run: | @@ -330,18 +330,18 @@ jobs: ./wrapping/dockcross-manylinux-build-module-wheels-opencl.sh cp${{ matrix.python-version }} - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: LinuxOpenCLWheel${{ matrix.python-version }} path: dist build-macos-opencl-python-packages: - runs-on: macos-11 + runs-on: macos-14 strategy: max-parallel: 2 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: 'Specific XCode version' run: | @@ -359,11 +359,11 @@ jobs: run: | export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.9 + export MACOSX_DEPLOYMENT_TARGET=14 ./macpython-download-cache-and-build-module-wheels.sh - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: MacOSOpenCLWheels path: dist @@ -373,7 +373,7 @@ jobs: - build-linux-opencl-python-packages - build-macos-opencl-python-packages - build-windows-opencl-python-packages - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Download Python Packages diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index ab5019f..48cb090 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -7,7 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master + with: + itk-branch: master with: error-message: 'Code is inconsistent with ITK Coding Style. Add the *action:ApplyClangFormat* PR label to correct.' diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 476a001..6f8a17e 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -27,7 +27,7 @@ jobs: if [ $(clinfo | grep "Number of devices" | awk '{print $4}') == "0" ]; then echo "Could not find OpenCL devices" && exit 1; fi shell: bash - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.22.2 diff --git a/include/itkVkBlurringPerformanceMetric.h b/include/itkVkBlurringPerformanceMetric.h index b528feb..1e52409 100644 --- a/include/itkVkBlurringPerformanceMetric.h +++ b/include/itkVkBlurringPerformanceMetric.h @@ -76,7 +76,7 @@ class VkBlurringPerformanceMetric : public LightObject itkNewMacro(Self); /** Run-time type information (and related methods). */ - itkTypeMacro(VkBlurringPerformanceMetric, LightObject); + itkOverrideGetNameOfClassMacro(VkBlurringPerformanceMetric); using ImageType = TImage; using KernelType = TKernel; diff --git a/include/itkVkComplexToComplex1DFFTImageFilter.h b/include/itkVkComplexToComplex1DFFTImageFilter.h index 65c8a99..878664b 100644 --- a/include/itkVkComplexToComplex1DFFTImageFilter.h +++ b/include/itkVkComplexToComplex1DFFTImageFilter.h @@ -78,7 +78,7 @@ class VkComplexToComplex1DFFTImageFilter : public ComplexToComplex1DFFTImageFilt itkNewMacro(Self); /** Run-time type information (and related methods). */ - itkTypeMacro(VkComplexToComplex1DFFTImageFilter, ComplexToComplex1DFFTImageFilter); + itkOverrideGetNameOfClassMacro(VkComplexToComplex1DFFTImageFilter); static constexpr unsigned int ImageDimension{ InputImageType::ImageDimension }; diff --git a/include/itkVkComplexToComplexFFTImageFilter.h b/include/itkVkComplexToComplexFFTImageFilter.h index 2d89d45..671ca01 100644 --- a/include/itkVkComplexToComplexFFTImageFilter.h +++ b/include/itkVkComplexToComplexFFTImageFilter.h @@ -75,7 +75,7 @@ class VkComplexToComplexFFTImageFilter : public ComplexToComplexFFTImageFilter; /** Run-time type information (and related methods). */ - itkTypeMacro(VkGlobalConfiguration, LightObject); + itkOverrideGetNameOfClassMacro(VkGlobalConfiguration); /** Default accelerated platform identifier */ static void diff --git a/include/itkVkHalfHermitianToRealInverseFFTImageFilter.h b/include/itkVkHalfHermitianToRealInverseFFTImageFilter.h index 4e33728..f78bb6c 100644 --- a/include/itkVkHalfHermitianToRealInverseFFTImageFilter.h +++ b/include/itkVkHalfHermitianToRealInverseFFTImageFilter.h @@ -81,7 +81,7 @@ class VkHalfHermitianToRealInverseFFTImageFilter itkNewMacro(Self); /** Run-time type information (and related methods). */ - itkTypeMacro(VkHalfHermitianToRealInverseFFTImageFilter, HalfHermitianToRealInverseFFTImageFilter); + itkOverrideGetNameOfClassMacro(VkHalfHermitianToRealInverseFFTImageFilter); static constexpr unsigned int ImageDimension{ InputImageType::ImageDimension }; diff --git a/include/itkVkInverse1DFFTImageFilter.h b/include/itkVkInverse1DFFTImageFilter.h index 672a337..386f321 100644 --- a/include/itkVkInverse1DFFTImageFilter.h +++ b/include/itkVkInverse1DFFTImageFilter.h @@ -83,7 +83,7 @@ class VkInverse1DFFTImageFilter : public Inverse1DFFTImageFilter