Skip to content

Commit b03d286

Browse files
authored
Merge pull request #20 from hzeller/feature-20250921-latest-format
Use later versions of clang-format
2 parents 6c8bfd0 + d1902a3 commit b03d286

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
# TODO: package ?
5656
5757
CodeFormatting:
58-
runs-on: ubuntu-24.04
58+
runs-on: ubuntu-latest
5959
steps:
6060
- name: Checkout code
6161
uses: actions/checkout@v4
@@ -64,13 +64,17 @@ jobs:
6464

6565
- name: Install Dependencies
6666
run: |
67+
wget https://apt.llvm.org/llvm.sh
68+
chmod +x ./llvm.sh
69+
sudo ./llvm.sh 19
70+
sudo apt install -y clang-format-19
6771
go install github.com/bazelbuild/buildtools/buildifier@latest
6872
echo "PATH=$PATH:$(go env GOPATH)/bin/" >> $GITHUB_ENV
6973
7074
- name: Run formatting style check
7175
run: |
72-
clang-format-17 --version
73-
CLANG_FORMAT=clang-format-17 scripts/run-format.sh
76+
clang-format-19 --version
77+
CLANG_FORMAT=clang-format-19 scripts/run-format.sh
7478
git diff > /tmp/format-diff
7579
if [ -s "/tmp/format-diff" ]; then
7680
echo "Difference to optimal formatting"
@@ -82,6 +86,8 @@ jobs:
8286
echo " git commit -a --amend"
8387
echo " git push -f"
8488
exit 1
89+
else
90+
echo "No changes. Good."
8591
fi
8692
8793
RunBantOnBant:
@@ -102,7 +108,7 @@ jobs:
102108
# This tests the static binary provided in the release, so
103109
# instead of simply compiling and running locally, we fetch that.
104110
# TODO: provide this as action where we simply say with version=...
105-
VERSION="v0.2.2"
111+
VERSION="v0.2.3"
106112
STATIC_VERSION="bant-${VERSION}-linux-static-x86_64"
107113
wget "https://github.com/hzeller/bant/releases/download/${VERSION}/${STATIC_VERSION}.tar.gz"
108114
tar xvzf "${STATIC_VERSION}.tar.gz"

bant/tool/dwyu_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class DWYUTestFixture {
130130
explicit DWYUTestFixture(const ParsedProject &project, int verbose_level = 1)
131131
: session_{&log_messages_, &log_messages_,
132132
CommandlineFlags{.verbose = verbose_level}},
133-
dwyu_(session_, project, edit_expector_.checker()){};
133+
dwyu_(session_, project, edit_expector_.checker()) {}
134134

135135
~DWYUTestFixture() {
136136
// Make sure that if there is a log output that the test will look for it.

shell.nix

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ pkgs ? import <nixpkgs> {} }:
22
let
33
bant_used_stdenv = pkgs.stdenv; # no layering_check but clangd works
4-
#bant_used_stdenv = pkgs.clang17Stdenv; # layering_check works, but clangd fails to understand c++ headers.
4+
#bant_used_stdenv = pkgs.clang19Stdenv; # layering_check works, but clangd fails to understand c++ headers.
55
in
66
bant_used_stdenv.mkDerivation {
77
name = "bant-build-environment";
@@ -10,16 +10,12 @@ bant_used_stdenv.mkDerivation {
1010
bazel_7
1111
jdk11
1212

13-
clang-tools_17 # for clang-format
14-
clang-tools_19 # for clang-tidy
13+
clang-tools_19 # for clang-tidy, clang-format
1514
bazel-buildtools # buildifier, buildozer
1615
];
1716
shellHook = ''
1817
# clang tidy: use latest.
1918
export CLANG_TIDY=${pkgs.clang-tools_19}/bin/clang-tidy
20-
21-
# There is too much volatility between even micro-versions of
22-
# newer clang-format. Let's use older for now.
23-
export CLANG_FORMAT=${pkgs.clang-tools_17}/bin/clang-format
19+
export CLANG_FORMAT=${pkgs.clang-tools_19}/bin/clang-format
2420
'';
2521
}

0 commit comments

Comments
 (0)