Skip to content

Commit 9ac26af

Browse files
authored
Fix #14149 (use same uncrustify version in CI and runformat script) (danmar#7849)
1 parent 413c87e commit 9ac26af

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ jobs:
5050
5151
- name: Uncrustify check
5252
run: |
53-
~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --no-backup --replace */*.cpp */*.h
53+
UNCRUSTIFY=~/uncrustify/uncrustify ./runformat
5454
git diff
5555
git diff | diff - /dev/null &> /dev/null

lib/smallvector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct TaggedAllocator : std::allocator<T>
3838
template<class ... Ts>
3939
// cppcheck-suppress noExplicitConstructor
4040
// NOLINTNEXTLINE(google-explicit-constructor)
41-
TaggedAllocator(Ts&&... ts)
41+
TaggedAllocator(Ts && ... ts)
4242
: std::allocator<T>(std::forward<Ts>(ts)...)
4343
{}
4444

runformat

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
#
3-
# uncrustify-0.72 is used to format cppcheck source code.
3+
# uncrustify-0.80.1 is used to format cppcheck source code.
44
#
5-
# 1. Download source code: https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.zip
5+
# 1. Download source code: https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.80.1.zip
66
# It's important that all Cppcheck developers use the exact same version so we don't get a "format battle".
77
# 2. Building:
88
# - Linux: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make
@@ -11,7 +11,7 @@
1111
# - you can put uncrustify in your PATH
1212
# - you can create an environment variable UNCRUSTIFY that has the full path of the binary
1313

14-
UNCRUSTIFY_VERSION="0.72.0"
14+
UNCRUSTIFY_VERSION="0.80.1"
1515
UNCRUSTIFY="${UNCRUSTIFY-uncrustify}"
1616

1717
DETECTED_VERSION=$("$UNCRUSTIFY" --version 2>&1 | grep -o -E '[0-9.]+')
@@ -44,11 +44,13 @@ function formatCplusplus {
4444

4545
}
4646

47-
formatCplusplus cli/
48-
formatCplusplus democlient/
49-
formatCplusplus gui/
50-
formatCplusplus lib/
51-
formatCplusplus oss-fuzz/
52-
formatCplusplus test/
53-
formatCplusplus tools/
54-
formatCplusplus samples/
47+
ls */*.cpp */*.h | xargs -n 1 -P $CPUCOUNT -I{} -t $UNCRUSTIFY -c .uncrustify.cfg -l CPP --no-backup --replace {}
48+
49+
#formatCplusplus cli/
50+
#formatCplusplus democlient/
51+
#formatCplusplus gui/
52+
#formatCplusplus lib/
53+
#formatCplusplus oss-fuzz/
54+
#formatCplusplus test/
55+
#formatCplusplus tools/
56+
#formatCplusplus samples/

0 commit comments

Comments
 (0)