Browse Source

clang-format.bash: update to clang-format-18

The `.clang-format` configuration needs no changes to make the
version 18 format close to what version 15 produced before.

Issue: #26123
Brad King 9 months ago
parent
commit
e641442149
5 changed files with 8 additions and 8 deletions
  1. 1 1
      .clang-format
  2. 1 1
      .gitattributes
  3. 1 1
      Help/dev/source.rst
  4. 1 1
      Utilities/.gitattributes
  5. 4 4
      Utilities/Scripts/clang-format.bash

+ 1 - 1
.clang-format

@@ -1,5 +1,5 @@
 ---
-# This configuration requires clang-format version 15 exactly.
+# This configuration requires clang-format version 18 exactly.
 BasedOnStyle: Mozilla
 AlignOperands: false
 AllowShortFunctionsOnASingleLine: InlineOnly

+ 1 - 1
.gitattributes

@@ -4,7 +4,7 @@
 .editorconfig    export-ignore
 
 # Custom attribute to mark sources as using our C code style.
-[attr]our-c-style  whitespace=tab-in-indent  format.clang-format=15
+[attr]our-c-style  whitespace=tab-in-indent  format.clang-format=18
 
 # Custom attribute to mark sources as generated.
 # Do not perform whitespace checks.  Do not format.

+ 1 - 1
Help/dev/source.rst

@@ -9,7 +9,7 @@ See documentation on `CMake Development`_ for more information.
 C++ Code Style
 ==============
 
-We use `clang-format`_ version **15** to define our style for C++ code in
+We use `clang-format`_ version **18** to define our style for C++ code in
 the CMake source tree.  See the `.clang-format`_ configuration file for our
 style settings.  Use the `Utilities/Scripts/clang-format.bash`_ script to
 format source code.  It automatically runs ``clang-format`` on the set of

+ 1 - 1
Utilities/.gitattributes

@@ -5,4 +5,4 @@ SetupForDevelopment.sh  export-ignore
 # Do not format third-party sources.
 /KWIML/**       -format.clang-format
 /cm*/**         -format.clang-format
-/cmcurl/curltest.c format.clang-format=15
+/cmcurl/curltest.c format.clang-format=18

+ 4 - 4
Utilities/Scripts/clang-format.bash

@@ -78,7 +78,7 @@ test "$#" = 0 || die "$usage"
 
 # Find a default tool.
 tools='
-  clang-format-15
+  clang-format-18
   clang-format
 '
 if test "x$clang_format" = "x"; then
@@ -96,8 +96,8 @@ if ! type -p "$clang_format" >/dev/null; then
     exit 1
 fi
 
-if ! "$clang_format" --version | grep 'clang-format version 15' >/dev/null 2>/dev/null; then
-    echo "clang-format version 15 is required (exactly)"
+if ! "$clang_format" --version | grep 'clang-format version 18' >/dev/null 2>/dev/null; then
+    echo "clang-format version 18 is required (exactly)"
     exit 1
 fi
 
@@ -116,7 +116,7 @@ $git_ls |
 
   # Select sources with our attribute.
   git check-attr --stdin format.clang-format |
-    sed -n '/: format\.clang-format: \(set\|15\)$/ {s/:[^:]*:[^:]*$//p}'  |
+    sed -n '/: format\.clang-format: \(set\|18\)$/ {s/:[^:]*:[^:]*$//p}'  |
 
   # Update sources in-place.
   xargs -d '\n' "$clang_format" -i