DoxigAlpha

create

Function parameters

Parameters

#
owner:*std.Build

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#

= .fmt

Values

#
base_id
= .fmt

Source

Implementation

#
pub fn create(owner: *std.Build, options: Options) *Fmt {
    const fmt = owner.allocator.create(Fmt) catch @panic("OOM");
    const name = if (options.check) "zig fmt --check" else "zig fmt";
    fmt.* = .{
        .step = Step.init(.{
            .id = base_id,
            .name = name,
            .owner = owner,
            .makeFn = make,
        }),
        .paths = owner.dupeStrings(options.paths),
        .exclude_paths = owner.dupeStrings(options.exclude_paths),
        .check = options.check,
    };
    return fmt;
}