build: add code formatting check

This commit is contained in:
Adrià Arrufat
2026-03-09 18:48:38 +09:00
parent 379a3f27b8
commit 5568340b9a
2 changed files with 11 additions and 1 deletions

View File

@@ -52,6 +52,17 @@ pub fn build(b: *Build) !void {
mod.addImport("lightpanda", mod); // allow circular "lightpanda" import
mod.addImport("build_config", opts.createModule());
// Format check
const fmt_step = b.step("fmt", "Check code formatting");
const fmt = b.addFmt(.{
.paths = &.{ "src", "build.zig", "build.zig.zon" },
.check = true,
});
fmt_step.dependOn(&fmt.step);
// Set default behavior
b.default_step.dependOn(fmt_step);
try linkV8(b, mod, enable_asan, enable_tsan, prebuilt_v8_path);
try linkCurl(b, mod);
try linkHtml5Ever(b, mod);