diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-05-29 10:09:40 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-05-29 10:09:40 -0700 |
| commit | bdb3b382d8f39ec1e38a72c473963381a065da0c (patch) | |
| tree | a11776ed7efa4d2bd785c0287acc1845cd6d1e1f /lib/compiler/fmt.zig | |
| parent | d750a78b2c0265bd7bb2b924c4c739cad5aa6666 (diff) | |
| download | zig-bdb3b382d8f39ec1e38a72c473963381a065da0c.tar.gz zig-bdb3b382d8f39ec1e38a72c473963381a065da0c.zip | |
zig fmt: ignore hidden files and directories
rather than ignoring specifically "zig-cache" and "zig-out". The latter
is not necessarily the install prefix and should not be special.
The former will be handled by renaming zig-cache to .zig-cache.
Diffstat (limited to 'lib/compiler/fmt.zig')
| -rw-r--r-- | lib/compiler/fmt.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compiler/fmt.zig b/lib/compiler/fmt.zig index 2fc04b7935..e549a05bdd 100644 --- a/lib/compiler/fmt.zig +++ b/lib/compiler/fmt.zig @@ -236,7 +236,7 @@ fn fmtPathDir( while (try dir_it.next()) |entry| { const is_dir = entry.kind == .directory; - if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue; + if (mem.startsWith(u8, entry.name, ".")) continue; if (is_dir or entry.kind == .file and (mem.endsWith(u8, entry.name, ".zig") or mem.endsWith(u8, entry.name, ".zon"))) { const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name }); |
