Fix zig lints, add zig lints to minici, update snapshots

This commit is contained in:
Richard Feldman 2025-12-09 20:05:01 -05:00
parent cb6431da7a
commit ad1bee07f4
No known key found for this signature in database
5 changed files with 35 additions and 2 deletions

View file

@ -764,6 +764,7 @@ const MiniCiStep = struct {
// Run the sequence of `zig build` commands that make up the
// mini CI pipeline.
try runSubBuild(step, "fmt", "zig build fmt");
try runZigLints(step);
try runSubBuild(step, null, "zig build");
try checkBuiltinRocFormatting(step);
try runSubBuild(step, "snapshot", "zig build snapshot");
@ -775,6 +776,36 @@ const MiniCiStep = struct {
try runSubBuild(step, "test-cli", "zig build test-cli");
}
fn runZigLints(step: *Step) !void {
const b = step.owner;
std.debug.print("---- minici: running zig lints ----\n", .{});
var child_argv = std.ArrayList([]const u8).empty;
defer child_argv.deinit(b.allocator);
try child_argv.append(b.allocator, b.graph.zig_exe);
try child_argv.append(b.allocator, "run");
try child_argv.append(b.allocator, "ci/zig_lints.zig");
var child = std.process.Child.init(child_argv.items, b.allocator);
child.stdin_behavior = .Inherit;
child.stdout_behavior = .Inherit;
child.stderr_behavior = .Inherit;
const term = try child.spawnAndWait();
switch (term) {
.Exited => |code| {
if (code != 0) {
return step.fail("Zig lints failed. Run 'zig run ci/zig_lints.zig' to see details.", .{});
}
},
else => {
return step.fail("zig run ci/zig_lints.zig terminated abnormally", .{});
},
}
}
fn checkBuiltinRocFormatting(step: *Step) !void {
const b = step.owner;
std.debug.print("---- minici: checking Builtin.roc formatting ----\n", .{});

View file

@ -6355,6 +6355,8 @@ fn canonicalizePatternOrMalformed(
}
}
/// Canonicalizes a parsed pattern from AST representation.
/// Returns the canonical pattern index, or null if the pattern should be skipped.
pub fn canonicalizePattern(
self: *Self,
ast_pattern_idx: AST.Pattern.Idx,

View file

@ -2657,7 +2657,7 @@ expect {
(exposes
(exposed (name "line!") (wildcard false))
(exposed (name "write!") (wildcard false))))
(s-import (module "MALFORMED_IMPORT")
(s-import (module "#malformed_import_0")
(exposes
(exposed (name "line!") (wildcard false))
(exposed (name "write!") (wildcard false))))

View file

@ -2543,7 +2543,7 @@ expect {
(exposes
(exposed (name "line!") (wildcard false))
(exposed (name "write!") (wildcard false))))
(s-import (module "MALFORMED_IMPORT")
(s-import (module "#malformed_import_0")
(exposes
(exposed (name "line!") (wildcard false))
(exposed (name "write!") (wildcard false))))