From 7e2b6b0f1bc5877f11c50a217dd88c11481bbad4 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 12 Sep 2023 14:19:16 -0700 Subject: [PATCH] Revert "ci: use zig build check-fmt instead of zig fmt --check" This reverts commit 4d1432299fe5dccef1e8254800e365c4d6c0d435. Please don't hard-code unrelated concerns this way. build.zig should not have awareness of the naming conventions for cmake build directories. --- build.zig | 9 ++------- ci/aarch64-linux-debug.sh | 5 ++++- ci/aarch64-linux-release.sh | 5 ++++- ci/x86_64-linux-debug.sh | 5 ++++- ci/x86_64-linux-release.sh | 6 +++++- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/build.zig b/build.zig index eff017ce22..5211a9a70a 100644 --- a/build.zig +++ b/build.zig @@ -422,18 +422,13 @@ pub fn build(b: *std.Build) !void { const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index]; const fmt_include_paths = &.{ "doc", "lib", "src", "test", "tools", "build.zig" }; - const fmt_exclude_paths = &.{ - "test/cases", - // This is for the CI scripts. - "build-debug", - "build-release", - }; + const fmt_exclude_paths = &.{"test/cases"}; const do_fmt = b.addFmt(.{ .paths = fmt_include_paths, .exclude_paths = fmt_exclude_paths, }); - b.step("check-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{ + b.step("test-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{ .paths = fmt_include_paths, .exclude_paths = fmt_exclude_paths, .check = true, diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index da77601ce5..6369777e88 100644 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -50,8 +50,11 @@ unset CXX ninja install +# TODO: move this to a build.zig step (check-fmt) echo "Looking for non-conforming code formatting..." -stage3-debug/bin/zig build check-fmt +stage3-debug/bin/zig fmt --check .. \ + --exclude ../test/cases/ \ + --exclude ../build-debug # simultaneously test building self-hosted without LLVM and with 32-bit arm stage3-debug/bin/zig build \ diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index bd9854cedc..369c14dc5f 100644 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -50,8 +50,11 @@ unset CXX ninja install +# TODO: move this to a build.zig step (check-fmt) echo "Looking for non-conforming code formatting..." -stage3-release/bin/zig build check-fmt +stage3-release/bin/zig fmt --check .. \ + --exclude ../test/cases/ \ + --exclude ../build-release # simultaneously test building self-hosted without LLVM and with 32-bit arm stage3-release/bin/zig build \ diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index e007d40013..2efca8f774 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -50,8 +50,11 @@ unset CXX ninja install +# TODO: move this to a build.zig step (check-fmt) echo "Looking for non-conforming code formatting..." -stage3-debug/bin/zig build check-fmt +stage3-debug/bin/zig fmt --check .. \ + --exclude ../test/cases/ \ + --exclude ../build-debug # simultaneously test building self-hosted without LLVM and with 32-bit arm stage3-debug/bin/zig build \ diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index 99c4eae732..4dc5c37927 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -50,8 +50,12 @@ unset CXX ninja install +# TODO: move this to a build.zig step (check-fmt) echo "Looking for non-conforming code formatting..." -stage3-release/bin/zig build check-fmt +stage3-release/bin/zig fmt --check .. \ + --exclude ../test/cases/ \ + --exclude ../build-debug \ + --exclude ../build-release # simultaneously test building self-hosted without LLVM and with 32-bit arm stage3-release/bin/zig build \