Skip to content

Commit edc2a3f

Browse files
authored
Clarify the preferable version for clang-format (#182)
The Ubuntu Linux 24.04 LTS release now includes Clang-format version 18 in its package management system. It is time to implement mandatory CI pipeline checks and routine code formatting verification.
1 parent ce03811 commit edc2a3f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.ci/check-format.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -x
66

77
for file in ${SOURCES};
88
do
9-
clang-format-16 ${file} > expected-format
9+
clang-format-18 ${file} > expected-format
1010
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
1111
done
12-
exit $(clang-format-16 --output-replacements-xml ${SOURCES} | grep -E -c "</replacement>")
12+
exit $(clang-format-18 --output-replacements-xml ${SOURCES} | grep -E -c "</replacement>")

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@v4
3737
- name: coding convention
3838
run: |
39-
sudo apt-get install -q -y clang-format-16
39+
sudo apt-get install -q -y clang-format-18
4040
.ci/check-newline.sh
4141
.ci/check-format.sh
4242
shell: bash

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ However, participation requires adherence to fundamental ground rules:
4444
This variant should be considered the standard for all documentation efforts.
4545
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".
4646

47-
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 12 or later.
47+
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
4848

4949
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones.
5050
For maintaining a uniform coding style, execute the command `clang-format -i *.[ch]`.

list.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct list_head {
5454
})
5555
#else
5656
#define container_of(ptr, type, member) \
57-
((type *) ((char *) (ptr) -offsetof(type, member)))
57+
((type *) ((char *) (ptr) - offsetof(type, member)))
5858
#endif
5959
#endif
6060

scripts/checksums

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h
2-
3337dbccc33eceedda78e36cc118d5a374838ec7 list.h
2+
bfb6df45d64356868c86a7173455d39970bd0270 list.h

0 commit comments

Comments
 (0)