Skip to content

Clarify the preferable version for clang-format #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci/check-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x

for file in ${SOURCES};
do
clang-format-16 ${file} > expected-format
clang-format-18 ${file} > expected-format
diff -u -p --label="${file}" --label="expected coding style" ${file} expected-format
done
exit $(clang-format-16 --output-replacements-xml ${SOURCES} | grep -E -c "</replacement>")
exit $(clang-format-18 --output-replacements-xml ${SOURCES} | grep -E -c "</replacement>")
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
- name: coding convention
run: |
sudo apt-get install -q -y clang-format-16
sudo apt-get install -q -y clang-format-18
.ci/check-newline.sh
.ci/check-format.sh
shell: bash
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ However, participation requires adherence to fundamental ground rules:
This variant should be considered the standard for all documentation efforts.
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".

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

This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones.
For maintaining a uniform coding style, execute the command `clang-format -i *.[ch]`.
Expand Down
2 changes: 1 addition & 1 deletion list.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct list_head {
})
#else
#define container_of(ptr, type, member) \
((type *) ((char *) (ptr) -offsetof(type, member)))
((type *) ((char *) (ptr) - offsetof(type, member)))
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion scripts/checksums
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h
3337dbccc33eceedda78e36cc118d5a374838ec7 list.h
bfb6df45d64356868c86a7173455d39970bd0270 list.h