From c8afe3412e207106e424182c7fddf673d1507dca Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Fri, 17 May 2024 02:12:39 +0900 Subject: [PATCH] clang-format: Show changes as diff in workflow Signed-off-by: Hector Martin --- .github/workflows/main.yml | 5 ++++- Makefile | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index debdaf44..4612d25c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: rm -f ~/.cargo/bin/cargo-fmt rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade - - name: install clang-format-17 + - name: install clang-format-18 run: | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' @@ -36,5 +36,8 @@ jobs: - name: Run format-check run: | + make format CLANG_FORMAT=clang-format-18 + git diff + git reset --hard make format-check CLANG_FORMAT=clang-format-18 make rustfmt-check diff --git a/Makefile b/Makefile index 8d1d56e0..2620e720 100644 --- a/Makefile +++ b/Makefile @@ -176,7 +176,7 @@ clean: format: $(CLANG_FORMAT) -i src/*.c src/dcp/*.c src/math/*.c src/*.h src/dcp/*.h src/math/*.h sysinc/*.h format-check: - $(CLANG_FORMAT) --dry-run --Werror src/*.c src/*.h src/dcp/*.c src/dcp/*.h sysinc/*.h + $(CLANG_FORMAT) --dry-run --Werror src/*.c src/dcp/*.c src/math/*.c src/*.h src/dcp/*.h src/math/*.h sysinc/*.h rustfmt: cd rust && cargo fmt rustfmt-check: