From bdb3b382d8f39ec1e38a72c473963381a065da0c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 29 May 2024 10:09:40 -0700 Subject: [PATCH] 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. --- lib/compiler/fmt.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler/fmt.zig b/lib/compiler/fmt.zig index 2fc04b7935a76e7a2f9acbc3e64e2ca81448a219..e549a05bdd300a4e0e4645a2c5d1da2a5af3e4c0 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 }); -- 2.54.0