]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Switch to clang-format-19 by default and allow //comment with no leading space
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 12 Feb 2025 07:57:10 +0000 (08:57 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 12 Feb 2025 07:57:10 +0000 (08:57 +0100)
Still some formatting differences, but they look legit. It seems
older versions of clang-format did not process preprocessor
conditionals correctly in all cases.

.clang-format
.github/workflows/formatting.yml
build-scripts/format-code

index e56bf7919702f28cc5cd3522642a9a99a92e87f5..aa363c30c952a6625c19f8d1d0136455bb68f880 100644 (file)
@@ -31,3 +31,9 @@ AllowAllParametersOfDeclarationOnNextLine: true
 BreakConstructorInitializers: AfterColon
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 SpaceInEmptyBlock: false
+
+# I'd rather have the default (Minimum 1) here, but that causes quite some churn
+SpacesInLineCommentPrefix:
+  Minimum: 0
+  Maximum: -1
+
index 4ac84a7e7772e96d490acaf6f87cb52d882a11eb..1e3e7a5e9e91291baeff1b65a1c841e8e85d1272 100644 (file)
@@ -21,7 +21,7 @@ jobs:
       - name: Update dependencies
         run: |
           sudo apt-get update
-          sudo apt-get -qq --no-install-recommends install git clang-19
+          sudo apt-get -qq --no-install-recommends install git clang-format-19
       - name: Run format-code on files that should be formatted
         run: |
            ./build-scripts/format-code $(find . -type f -name '*.[ch][ch]' | sort | comm -23 - .not-formatted)
index 62914f56480b3db4ed77b711d67f57fd6abdf559..2da740a9b5b57469aa99428c755d230f1d343a10 100755 (executable)
@@ -28,7 +28,7 @@ if [ x$CIRCLECI = xtrue ]; then
     verbose=0
 fi
 
-FORMAT=clang-format-11
+FORMAT=clang-format-19
 if ! which $FORMAT 2> /dev/null; then
     FORMAT=clang-format
 fi