mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
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.
This commit is contained in:
parent
f33bb0228b
commit
4d1432299f
@ -422,13 +422,18 @@ pub fn build(b: *std.Build) !void {
|
|||||||
const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index];
|
const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index];
|
||||||
|
|
||||||
const fmt_include_paths = &.{ "doc", "lib", "src", "test", "tools", "build.zig" };
|
const fmt_include_paths = &.{ "doc", "lib", "src", "test", "tools", "build.zig" };
|
||||||
const fmt_exclude_paths = &.{"test/cases"};
|
const fmt_exclude_paths = &.{
|
||||||
|
"test/cases",
|
||||||
|
// This is for the CI scripts.
|
||||||
|
"build-debug",
|
||||||
|
"build-release",
|
||||||
|
};
|
||||||
const do_fmt = b.addFmt(.{
|
const do_fmt = b.addFmt(.{
|
||||||
.paths = fmt_include_paths,
|
.paths = fmt_include_paths,
|
||||||
.exclude_paths = fmt_exclude_paths,
|
.exclude_paths = fmt_exclude_paths,
|
||||||
});
|
});
|
||||||
|
|
||||||
b.step("test-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{
|
b.step("check-fmt", "Check source files having conforming formatting").dependOn(&b.addFmt(.{
|
||||||
.paths = fmt_include_paths,
|
.paths = fmt_include_paths,
|
||||||
.exclude_paths = fmt_exclude_paths,
|
.exclude_paths = fmt_exclude_paths,
|
||||||
.check = true,
|
.check = true,
|
||||||
|
|||||||
@ -50,11 +50,8 @@ unset CXX
|
|||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
# TODO: move this to a build.zig step (check-fmt)
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
echo "Looking for non-conforming code formatting..."
|
||||||
stage3-debug/bin/zig fmt --check .. \
|
stage3-debug/bin/zig build check-fmt
|
||||||
--exclude ../test/cases/ \
|
|
||||||
--exclude ../build-debug
|
|
||||||
|
|
||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-debug/bin/zig build \
|
stage3-debug/bin/zig build \
|
||||||
|
|||||||
@ -50,11 +50,8 @@ unset CXX
|
|||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
# TODO: move this to a build.zig step (check-fmt)
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
echo "Looking for non-conforming code formatting..."
|
||||||
stage3-release/bin/zig fmt --check .. \
|
stage3-release/bin/zig build check-fmt
|
||||||
--exclude ../test/cases/ \
|
|
||||||
--exclude ../build-release
|
|
||||||
|
|
||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-release/bin/zig build \
|
stage3-release/bin/zig build \
|
||||||
|
|||||||
@ -50,11 +50,8 @@ unset CXX
|
|||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
# TODO: move this to a build.zig step (check-fmt)
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
echo "Looking for non-conforming code formatting..."
|
||||||
stage3-debug/bin/zig fmt --check .. \
|
stage3-debug/bin/zig build check-fmt
|
||||||
--exclude ../test/cases/ \
|
|
||||||
--exclude ../build-debug
|
|
||||||
|
|
||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-debug/bin/zig build \
|
stage3-debug/bin/zig build \
|
||||||
|
|||||||
@ -50,12 +50,8 @@ unset CXX
|
|||||||
|
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
# TODO: move this to a build.zig step (check-fmt)
|
|
||||||
echo "Looking for non-conforming code formatting..."
|
echo "Looking for non-conforming code formatting..."
|
||||||
stage3-release/bin/zig fmt --check .. \
|
stage3-release/bin/zig build check-fmt
|
||||||
--exclude ../test/cases/ \
|
|
||||||
--exclude ../build-debug \
|
|
||||||
--exclude ../build-release
|
|
||||||
|
|
||||||
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
# simultaneously test building self-hosted without LLVM and with 32-bit arm
|
||||||
stage3-release/bin/zig build \
|
stage3-release/bin/zig build \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user