Skip to content

Commit 42e3e84

Browse files
committed
Upgrade to clang-format-18
1 parent 84fc375 commit 42e3e84

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.semaphore/semaphore.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ blocks:
7878
- name: 'Style check'
7979
commands:
8080
- sudo apt update
81-
- sudo apt install -y clang-format-10 python3 python3-pip python3-setuptools
81+
- sudo apt install -y clang-format-18 python3 python3-pip python3-setuptools
8282
- python3 -m pip install -r packaging/tools/requirements.txt
83-
- CLANG_FORMAT=clang-format-10 make style-check
83+
- make style-check
8484

8585

8686
- name: 'Build documentation'

packaging/tools/style-format.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
# Check or apply/fix the project coding style to all files passed as arguments.
44
# Uses clang-format for C/C++ and flake8 for Python.
55
#
6-
# Requires clang-format version 10 (apt install clang-format-10).
7-
#
86

97

10-
CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
8+
9+
# Requires clang-format version 18 (apt install clang-format-18).
10+
CLANG_FORMAT=${CLANG_FORMAT:-clang-format-18}
11+
CLANG_FORMAT_REQUIRED_VERSION=18
1112

1213
set -e
1314

@@ -27,8 +28,8 @@ else
2728
fi
2829

2930
clang_format_version=$(${CLANG_FORMAT} --version | sed -Ee 's/.*version ([[:digit:]]+)\.[[:digit:]]+\.[[:digit:]]+.*/\1/')
30-
if [[ $clang_format_version != "10" ]] ; then
31-
echo "$0: clang-format version 10, '$clang_format_version' detected"
31+
if [[ $clang_format_version != "$CLANG_FORMAT_REQUIRED_VERSION" ]] ; then
32+
echo "$0: clang-format version ${CLANG_FORMAT_REQUIRED_VERSION}, '$clang_format_version' detected"
3233
exit 1
3334
fi
3435

0 commit comments

Comments
 (0)