Skip to content

Commit

Permalink
ci: Move to clang-format version 18
Browse files Browse the repository at this point in the history
This makes use of the fact that we have moved CI to Ubuntu 24.04, and
are no longer constrained to the old versions offered by Ubuntu 20.04.
  • Loading branch information
rettichschnidi committed Nov 24, 2024
1 parent d28bd14 commit b9360fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ Wakaama provides a simple CLI library. It can be enabled with:
- Version control system: Git (and a GitHub account)
- Git commit message linter: gitlint
- Build system: ninja
- C code formatting: clang-format, version 14
- C code formatting: clang-format, version 18
- CMake list files formatting: cmake-format, version 0.6.13
- Unit testing: CUnit

On Ubuntu 20.04, used in CI, the dependencies can be installed as such:
- `apt install build-essential clang-format clang-format-14 clang-tools-14 cmake gcovr git libcunit1-dev ninja-build python3-pip`
On Ubuntu 24.04, used in CI, the dependencies can be installed as such:
- `apt install build-essential clang-format clang-format-18 clang-tools-18 cmake gcovr git libcunit1-dev ninja-build python3-pip`
- `pip3 install -r tools/requirements-compliance.txt`

For macOS the development dependencies can be installed as such:
Expand All @@ -148,9 +148,9 @@ The style is based on the LLVM style, but with 4 instead of 2 spaces indentation
characters per line.

To check if your code matches the expected style, the following commands are helpful:
- `git clang-format-14 --diff`: Show what needs to be changed to match the expected code style
- `git clang-format-14`: Apply all needed changes directly
- `git clang-format-14 --commit main`: Fix code style for all changes since main
- `git clang-format-18 --diff`: Show what needs to be changed to match the expected code style
- `git clang-format-18`: Apply all needed changes directly
- `git clang-format-1n --commit main`: Fix code style for all changes since main

If existing code gets reformatted, this must be done in a separate commit. Its commit id has to be added to the file
`.git-blame-ignore-revs` and committed in yet another commit.
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ OPT_BRANCH_SOURCE=
OPT_BRANCH_TARGET=main
OPT_C_EXTENSIONS=""
OPT_C_STANDARD=""
OPT_CLANG_FORMAT="clang-format-14"
OPT_CLANG_FORMAT="clang-format-18"
OPT_SANITIZER=""
OPT_SCAN_BUILD=""
OPT_SONARQUBE=""
Expand Down

0 comments on commit b9360fa

Please sign in to comment.