mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
Fix zig lints, add zig lints to minici, update snapshots
This commit is contained in:
parent
cb6431da7a
commit
ad1bee07f4
5 changed files with 35 additions and 2 deletions
31
build.zig
31
build.zig
|
|
@ -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", .{});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue