866f0929
build: zig build fmt gate + check umbrella (fmt + unit tests)
a73x 2026-08-14 07:39
Commit message
build.zig
| Old | New | ||
|---|---|---|---|
| @@ -680,4 +680,16 @@ pub fn build(b: *std.Build) void { | |||
| 680 | bench.addArtifactArg(mux_exe); | 680 | bench.addArtifactArg(mux_exe); |
| 681 | const bench_step = b.step("bench", "Measure delta vs snapshot bytes"); | 681 | const bench_step = b.step("bench", "Measure delta vs snapshot bytes"); |
| 682 | bench_step.dependOn(&bench.step); | 682 | bench_step.dependOn(&bench.step); |
| 683 | |||
| 684 | // The format gate. `check = true` makes this a --check run: it fails | ||
| 685 | // naming the offending files and rewrites nothing. | ||
| 686 | const fmt_step = b.step("fmt", "Check formatting (zig fmt --check)"); | ||
| 687 | const fmt = b.addFmt(.{ .paths = &.{ "build.zig", "src", "test" }, .check = true }); | ||
| 688 | fmt_step.dependOn(&fmt.step); | ||
| 689 | |||
| 690 | // The seconds-long pre-commit gate: fmt + unit tests. e2e/agent/soak | ||
| 691 | // stay separate on purpose — they are minutes-long and process-spawning. | ||
| 692 | const check_step = b.step("check", "fmt + unit tests — the pre-commit gate"); | ||
| 693 | check_step.dependOn(fmt_step); | ||
| 694 | check_step.dependOn(test_step); | ||
| 683 | } | 695 | } |