diff --git a/README.md b/README.md index 249fdde65a..bfe23dd788 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ This is written with help from LLM: Quick test: - zig build test + zig build fmt test -Full test with all supported compilers and valgrind (run before commit, -takes a while): +Full test and static analysis with all supported compilers and valgrind (run +before commit, takes a while): - zig build fmt && zig build -Dvalgrind + zig build -Dvalgrind # Debugging tips diff --git a/build.zig b/build.zig index b19f28e694..e63a596441 100644 --- a/build.zig +++ b/build.zig @@ -116,19 +116,18 @@ pub fn build(b: *std.Build) !void { lint_step.dependOn(&cppcheck.step); } - const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers"); - all_step.dependOn(lint_step); - const fmt_check = b.addSystemCommand(&.{ "clang-format", "--dry-run", "-Werror" }); for (all_c_files ++ headers) |f| fmt_check.addFileArg(b.path(f)); fmt_check.expectExitCode(0); - all_step.dependOn(&fmt_check.step); + b.default_step.dependOn(&fmt_check.step); for (compilers) |compiler| { - addTestStep(b, all_step, target, optimize, compiler, false, valgrind, test_timeout); + addTestStep(b, b.default_step, target, optimize, compiler, false, valgrind, test_timeout); } - b.default_step = all_step; + const all_step = b.step("all", "Run fmt check, lint, and tests with all compilers"); + all_step.dependOn(b.default_step); + all_step.dependOn(lint_step); } fn addTestStep(