From 5568340b9a7948e7990cdfd7c58a1b7f311ca1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Mon, 9 Mar 2026 18:48:38 +0900 Subject: [PATCH] build: add code formatting check --- build.zig | 11 +++++++++++ build.zig.zon | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 7e3a2817..d4eabcea 100644 --- a/build.zig +++ b/build.zig @@ -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); diff --git a/build.zig.zon b/build.zig.zon index b7525c77..eb3812a8 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -7,7 +7,6 @@ .v8 = .{ .url = "https://github.com/lightpanda-io/zig-v8-fork/archive/refs/tags/v0.3.1.tar.gz", .hash = "v8-0.0.0-xddH64J7BAC81mkf6G9RbEJxS-W3TIRl5iFnShwbqCqy", - }, //.v8 = .{ .path = "../zig-v8-fork" }, .brotli = .{