From c56a6d474f790714daf6666993292d96853a6621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 23 Sep 2025 17:22:34 +0200 Subject: [PATCH] Fix #14149 (use same uncrustify version in CI and runformat script) --- .github/workflows/format.yml | 2 +- lib/smallvector.h | 2 +- runformat | 24 +++++++++++++----------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 8ad9408a376..fd491c0ec0e 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -50,6 +50,6 @@ jobs: - name: Uncrustify check run: | - ~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --no-backup --replace */*.cpp */*.h + UNCRUSTIFY=~/uncrustify/uncrustify ./runformat git diff git diff | diff - /dev/null &> /dev/null diff --git a/lib/smallvector.h b/lib/smallvector.h index 3eb423288a0..41f4798184e 100644 --- a/lib/smallvector.h +++ b/lib/smallvector.h @@ -38,7 +38,7 @@ struct TaggedAllocator : std::allocator template // cppcheck-suppress noExplicitConstructor // NOLINTNEXTLINE(google-explicit-constructor) - TaggedAllocator(Ts&&... ts) + TaggedAllocator(Ts && ... ts) : std::allocator(std::forward(ts)...) {} diff --git a/runformat b/runformat index 60ad1b2abe1..f823229ecc7 100755 --- a/runformat +++ b/runformat @@ -1,8 +1,8 @@ #!/bin/bash # -# uncrustify-0.72 is used to format cppcheck source code. +# uncrustify-0.80.1 is used to format cppcheck source code. # -# 1. Download source code: https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.zip +# 1. Download source code: https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.80.1.zip # It's important that all Cppcheck developers use the exact same version so we don't get a "format battle". # 2. Building: # - Linux: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make @@ -11,7 +11,7 @@ # - you can put uncrustify in your PATH # - you can create an environment variable UNCRUSTIFY that has the full path of the binary -UNCRUSTIFY_VERSION="0.72.0" +UNCRUSTIFY_VERSION="0.80.1" UNCRUSTIFY="${UNCRUSTIFY-uncrustify}" DETECTED_VERSION=$("$UNCRUSTIFY" --version 2>&1 | grep -o -E '[0-9.]+') @@ -44,11 +44,13 @@ function formatCplusplus { } -formatCplusplus cli/ -formatCplusplus democlient/ -formatCplusplus gui/ -formatCplusplus lib/ -formatCplusplus oss-fuzz/ -formatCplusplus test/ -formatCplusplus tools/ -formatCplusplus samples/ +ls */*.cpp */*.h | xargs -n 1 -P $CPUCOUNT -I{} -t $UNCRUSTIFY -c .uncrustify.cfg -l CPP --no-backup --replace {} + +#formatCplusplus cli/ +#formatCplusplus democlient/ +#formatCplusplus gui/ +#formatCplusplus lib/ +#formatCplusplus oss-fuzz/ +#formatCplusplus test/ +#formatCplusplus tools/ +#formatCplusplus samples/