Skip to content

Commit 3459e2f

Browse files
committed
runformat: use same uncrustify version in CI and in runformat, and ensure that the same commands are used in CI and in runformat
1 parent b4f07cd commit 3459e2f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.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

runformat

Lines changed: 4 additions & 4 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.]+')
@@ -40,7 +40,7 @@ function formatCplusplus {
4040
find $1 -iname '*.h' \
4141
-o -iname '*.c' \
4242
-o -iname '*.cpp' \
43-
| xargs -n 1 -P $CPUCOUNT -I{} -t $UNCRUSTIFY -c .uncrustify.cfg --no-backup {}
43+
| xargs -n 1 -P $CPUCOUNT -I{} -t $UNCRUSTIFY -c .uncrustify.cfg -l CPP --no-backup {}
4444

4545
}
4646

0 commit comments

Comments
 (0)