mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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.
This commit is contained in:
parent
d750a78b2c
commit
bdb3b382d8
1 changed files with 1 additions and 1 deletions
|
|
@ -236,7 +236,7 @@ fn fmtPathDir(
|
||||||
while (try dir_it.next()) |entry| {
|
while (try dir_it.next()) |entry| {
|
||||||
const is_dir = entry.kind == .directory;
|
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"))) {
|
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 });
|
const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue