MCPcopy Create free account
hub / github.com/delinoio/oss / stagedFormatFiles

Function stagedFormatFiles

scripts/ci/format-changed.mjs:60–82  ·  view source on GitHub ↗
(cwd)

Source from the content-addressed store, hash-verified

58}
59
60export function stagedFormatFiles(cwd) {
61 return git(
62 cwd,
63 "diff",
64 "--cached",
65 "--name-only",
66 "--no-renames",
67 "--diff-filter=ACMRT",
68 "-z",
69 "--",
70 )
71 .split("\0")
72 .filter((name) => {
73 if (!extensions.has(extname(name))) return false;
74 try {
75 return lstatSync(resolve(cwd, name)).isFile();
76 } catch (error) {
77 if (error.code === "ENOENT") return false;
78 throw error;
79 }
80 })
81 .sort();
82}
83
84export function changedFormatFiles(cwd, base, head, local = false) {
85 revision(cwd, base);

Callers 2

mainFunction · 0.85

Calls 3

hasMethod · 0.80
gitFunction · 0.70
resolveFunction · 0.50

Tested by

no test coverage detected