mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-30 21:07:34 +03:00
maker: fix Step.Fmt
This commit is contained in:
@@ -19,11 +19,12 @@ const WebServer = @import("WebServer.zig");
|
||||
const Maker = @import("../Maker.zig");
|
||||
|
||||
pub const Compile = @import("Step/Compile.zig");
|
||||
pub const Run = @import("Step/Run.zig");
|
||||
pub const Fmt = @import("Step/Fmt.zig");
|
||||
pub const InstallArtifact = @import("Step/InstallArtifact.zig");
|
||||
pub const InstallFile = @import("Step/InstallFile.zig");
|
||||
pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
|
||||
pub const ObjCopy = @import("Step/ObjCopy.zig");
|
||||
pub const Run = @import("Step/Run.zig");
|
||||
pub const UpdateSourceFiles = @import("Step/UpdateSourceFiles.zig");
|
||||
|
||||
/// Avoid false sharing.
|
||||
_: void align(std.atomic.cache_line) = {},
|
||||
@@ -73,7 +74,7 @@ pub const Extended = union(enum) {
|
||||
config_header: Todo,
|
||||
fail: Fail,
|
||||
find_program: Todo,
|
||||
fmt: Todo,
|
||||
fmt: Fmt,
|
||||
install_artifact: InstallArtifact,
|
||||
install_dir: Todo,
|
||||
install_file: InstallFile,
|
||||
|
||||
@@ -106,7 +106,6 @@ pub fn make(
|
||||
try man.writeManifest();
|
||||
}
|
||||
|
||||
|
||||
fn render_autoconf_undef(
|
||||
step: *Step,
|
||||
contents: []const u8,
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn make(
|
||||
const conf_step = step_index.ptr(conf);
|
||||
const conf_fmt = conf_step.extended.get(conf.extra).fmt;
|
||||
const paths = conf_fmt.paths.slice;
|
||||
const exclude_paths = conf_fmt.paths.exclude_paths;
|
||||
const exclude_paths = conf_fmt.exclude_paths.slice;
|
||||
|
||||
argv.clearRetainingCapacity();
|
||||
try argv.ensureUnusedCapacity(gpa, 2 + 1 + paths.len + 2 * exclude_paths.len);
|
||||
@@ -32,23 +32,23 @@ pub fn make(
|
||||
argv.appendAssumeCapacity(graph.zig_exe);
|
||||
argv.appendAssumeCapacity("fmt");
|
||||
|
||||
if (fmt.check)
|
||||
if (conf_fmt.flags.check)
|
||||
argv.appendAssumeCapacity("--check");
|
||||
|
||||
for (fmt.paths) |lp|
|
||||
for (paths) |lp|
|
||||
argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
|
||||
|
||||
for (fmt.exclude_paths) |lp| {
|
||||
for (exclude_paths) |lp| {
|
||||
argv.appendAssumeCapacity("--exclude");
|
||||
argv.appendAssumeCapacity(try maker.resolveLazyPathIndexAbs(arena, lp, step_index));
|
||||
}
|
||||
|
||||
const run_result = try step.captureChildProcess(maker, progress_node, argv.items);
|
||||
if (fmt.check) switch (run_result.term) {
|
||||
if (conf_fmt.flags.check) switch (run_result.term) {
|
||||
.exited => |code| if (code != 0 and run_result.stdout.len != 0) {
|
||||
var it = std.mem.tokenizeScalar(u8, run_result.stdout, '\n');
|
||||
while (it.next()) |bad_file_name| {
|
||||
try step.addError("{s}: non-conforming formatting", .{bad_file_name});
|
||||
try step.addError(maker, "{s}: non-conforming formatting", .{bad_file_name});
|
||||
}
|
||||
},
|
||||
else => {},
|
||||
|
||||
@@ -6,7 +6,6 @@ const Configuration = std.Build.Configuration;
|
||||
const Step = @import("../Step.zig");
|
||||
const Maker = @import("../../Maker.zig");
|
||||
|
||||
|
||||
pub fn make(
|
||||
options: *Options,
|
||||
step_index: Configuration.Step.Index,
|
||||
@@ -81,4 +80,3 @@ pub fn make(
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
fn make(step: *Step, options: Step.MakeOptions) !void {
|
||||
const prog_node = options.progress_node;
|
||||
const b = step.owner;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
fn make(step: *Step, options: Step.MakeOptions) !void {
|
||||
_ = options;
|
||||
const b = step.owner;
|
||||
|
||||
Reference in New Issue
Block a user