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

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

Issue: #24315
stage/master/nightly/2023/01/19
Brad King 2023-01-18 12:45:07 -05:00
parent 9ee57226bc
commit 6739d57948
4 changed files with 7 additions and 7 deletions

View File

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

2
.gitattributes vendored
View File

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

View File

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

View File

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