Skip to content

Commit

Permalink
update to clang-format-17
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-h committed Jul 10, 2024
1 parent 6943e4b commit a8de4b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .ci/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ while read -r file; do
if [[ "$is_cpp" == true ]]; then
# ClangFormat
if [[ "$_fix" == true ]]; then
clang-format-16 -i "$file"
clang-format-17 -i "$file"
else
# Workaround "set -e" and store exit code
format_exit_code=0
output="$(clang-format-16 --dry-run --Werror "$file" 2>&1)" || format_exit_code=$?
output="$(clang-format-17 --dry-run --Werror "$file" 2>&1)" || format_exit_code=$?
if [[ $format_exit_code -ne 0 ]]; then
EXIT_CODE=1
echo "::error::ClangFormat found issues in: $file"
#echo "$output"
# Show detailed diff. Requires ClangFormat to run again, but should mostly affect only a few files.
clang-format-16 "$file" | diff --color=always -u "$file" - || true
clang-format-17 "$file" | diff --color=always -u "$file" - || true
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions .ci/install-clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ set -e
set -o pipefail

wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository --yes "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get install -y clang-format-16
sudo add-apt-repository --yes "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-17 main"
sudo apt-get install -y clang-format-17

0 comments on commit a8de4b5

Please sign in to comment.