tiny.smg.command.scan.progress
Defined in command.scan.
API (4)
Actions
Public operations.
Source
Source: tools/smg/src/command/scan/progress.zig
zig
const std = @import("std");const smg = @import("../../root.zig");const scan = smg.scan;pub fn startLine(allocator: std.mem.Allocator, root: []const u8, rules_path: []const u8) ![]const u8 { return try std.fmt.allocPrint( allocator, "refresh-check: scan source root={s} rules={s}\n", .{ root, rules_path }, );}pub fn absentLine(allocator: std.mem.Allocator, stats: scan.Stats) ![]const u8 { return try std.fmt.allocPrint( allocator, "refresh-check: source snapshot absent; scanned {d} files; save graph/index\n", .{stats.files}, );}pub fn changedLine(allocator: std.mem.Allocator, files: usize) ![]const u8 { return try std.fmt.allocPrint( allocator, "refresh-check: scanned {d} changed files; save graph/index\n", .{files}, );}pub fn matchedLine(allocator: std.mem.Allocator, files: usize) ![]const u8 { return try std.fmt.allocPrint( allocator, "refresh-check: matched {d} source files; verify graph/index\n", .{files}, );}test "refresh-check progress names scan save and check phases" { const start = try startLine(std.testing.allocator, "/repo", "/repo/tools/smg/data/rules"); defer std.testing.allocator.free(start); try std.testing.expectEqualStrings("refresh-check: scan source root=/repo rules=/repo/tools/smg/data/rules\n", start); const absent = try absentLine(std.testing.allocator, .{ .files = 42 }); defer std.testing.allocator.free(absent); try std.testing.expectEqualStrings( "refresh-check: source snapshot absent; scanned 42 files; save graph/index\n", absent, ); const changed = try changedLine(std.testing.allocator, 2); defer std.testing.allocator.free(changed); try std.testing.expectEqualStrings("refresh-check: scanned 2 changed files; save graph/index\n", changed); const matched = try matchedLine(std.testing.allocator, 43); defer std.testing.allocator.free(matched); try std.testing.expectEqualStrings("refresh-check: matched 43 source files; verify graph/index\n", matched);}Source: tools/smg/src/command/scan/root.zig:7
zig
pub const progress = @import("progress.zig");Audit
| Definitions | 5 |
|---|---|
| Public names | 9 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |