authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2023-08-29 23:10:36+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-09-09 15:49:18+03:00
log4d1432299fe5dccef1e8254800e365c4d6c0d435
treee9206b8f21e4c3bd5d6c579ad989864a18ce39d9
parentf33bb0228b40a1171fafad40415bd5744e617e21

ci: use zig build check-fmt instead of zig fmt --check

We already have a zig build step for this: test-fmt. * Rename the test-fmt step to check-fmt. test-fmt sounds like it runs tests for `zig fmt` itself (lib/std/zig/render.zig). * Use it instead of `zig fmt --check` in the CI scripts. * Also use it in CI scripts that didn't have this check before.

5 files changed, 11 insertions(+), 19 deletions(-)

build.zig+7-2
...@@ -422,13 +422,18 @@ pub fn build(b: *std.Build) !void {...@@ -422,13 +422,18 @@ pub fn build(b: *std.Build) !void {
422 const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index];422 const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index];
423423
424 const fmt_include_paths = &.{ "doc", "lib", "src", "test", "tools", "build.zig" };424 const fmt_include_paths = &.{ "doc", "lib", "src", "test", "tools", "build.zig" };
425 const fmt_exclude_paths = &.{"test/cases"};425 const fmt_exclude_paths = &.{
426 "test/cases",
427 // This is for the CI scripts.
428 "build-debug",
429 "build-release",
430 };
426 const do_fmt = b.addFmt(.{431 const do_fmt = b.addFmt(.{
427 .paths = fmt_include_paths,432 .paths = fmt_include_paths,
428 .exclude_paths = fmt_exclude_paths,433 .exclude_paths = fmt_exclude_paths,
429 });434 });
430435
431 b.step("test-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{436 b.step("check-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{
432 .paths = fmt_include_paths,437 .paths = fmt_include_paths,
433 .exclude_paths = fmt_exclude_paths,438 .exclude_paths = fmt_exclude_paths,
434 .check = true,439 .check = true,
ci/aarch64-linux-debug.sh+1-4
...@@ -50,11 +50,8 @@ unset CXX...@@ -50,11 +50,8 @@ unset CXX
5050
51ninja install51ninja install
5252
53# TODO: move this to a build.zig step (check-fmt)
54echo "Looking for non-conforming code formatting..."53echo "Looking for non-conforming code formatting..."
55stage3-debug/bin/zig fmt --check .. \54stage3-debug/bin/zig build check-fmt
56 --exclude ../test/cases/ \
57 --exclude ../build-debug
5855
59# simultaneously test building self-hosted without LLVM and with 32-bit arm56# simultaneously test building self-hosted without LLVM and with 32-bit arm
60stage3-debug/bin/zig build \57stage3-debug/bin/zig build \
ci/aarch64-linux-release.sh+1-4
...@@ -50,11 +50,8 @@ unset CXX...@@ -50,11 +50,8 @@ unset CXX
5050
51ninja install51ninja install
5252
53# TODO: move this to a build.zig step (check-fmt)
54echo "Looking for non-conforming code formatting..."53echo "Looking for non-conforming code formatting..."
55stage3-release/bin/zig fmt --check .. \54stage3-release/bin/zig build check-fmt
56 --exclude ../test/cases/ \
57 --exclude ../build-release
5855
59# simultaneously test building self-hosted without LLVM and with 32-bit arm56# simultaneously test building self-hosted without LLVM and with 32-bit arm
60stage3-release/bin/zig build \57stage3-release/bin/zig build \
ci/x86_64-linux-debug.sh+1-4
...@@ -50,11 +50,8 @@ unset CXX...@@ -50,11 +50,8 @@ unset CXX
5050
51ninja install51ninja install
5252
53# TODO: move this to a build.zig step (check-fmt)
54echo "Looking for non-conforming code formatting..."53echo "Looking for non-conforming code formatting..."
55stage3-debug/bin/zig fmt --check .. \54stage3-debug/bin/zig build check-fmt
56 --exclude ../test/cases/ \
57 --exclude ../build-debug
5855
59# simultaneously test building self-hosted without LLVM and with 32-bit arm56# simultaneously test building self-hosted without LLVM and with 32-bit arm
60stage3-debug/bin/zig build \57stage3-debug/bin/zig build \
ci/x86_64-linux-release.sh+1-5
...@@ -50,12 +50,8 @@ unset CXX...@@ -50,12 +50,8 @@ unset CXX
5050
51ninja install51ninja install
5252
53# TODO: move this to a build.zig step (check-fmt)
54echo "Looking for non-conforming code formatting..."53echo "Looking for non-conforming code formatting..."
55stage3-release/bin/zig fmt --check .. \54stage3-release/bin/zig build check-fmt
56 --exclude ../test/cases/ \
57 --exclude ../build-debug \
58 --exclude ../build-release
5955
60# simultaneously test building self-hosted without LLVM and with 32-bit arm56# simultaneously test building self-hosted without LLVM and with 32-bit arm
61stage3-release/bin/zig build \57stage3-release/bin/zig build \