Skip to content

Commit bdb3b38

Browse files
committed
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.
1 parent d750a78 commit bdb3b38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/compiler/fmt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn fmtPathDir(
236236
while (try dir_it.next()) |entry| {
237237
const is_dir = entry.kind == .directory;
238238

239-
if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue;
239+
if (mem.startsWith(u8, entry.name, ".")) continue;
240240

241241
if (is_dir or entry.kind == .file and (mem.endsWith(u8, entry.name, ".zig") or mem.endsWith(u8, entry.name, ".zon"))) {
242242
const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });

0 commit comments

Comments
 (0)