MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / project

Function project

packages/cli/src/utils/lintFormat.test.ts:13–34  ·  view source on GitHub ↗
(
  files: Array<{ file: string; findings: HyperframeLintFinding[] }>,
)

Source from the content-addressed store, hash-verified

11}
12
13function project(
14 files: Array<{ file: string; findings: HyperframeLintFinding[] }>,
15): ProjectLintResult {
16 const all = files.flatMap((f) => f.findings);
17 const count = (severity: HyperframeLintFinding["severity"]) =>
18 all.filter((f) => f.severity === severity).length;
19 return {
20 results: files.map(({ file, findings }) => ({
21 file,
22 result: {
23 ok: findings.every((f) => f.severity !== "error"),
24 errorCount: findings.filter((f) => f.severity === "error").length,
25 warningCount: findings.filter((f) => f.severity === "warning").length,
26 infoCount: findings.filter((f) => f.severity === "info").length,
27 findings,
28 },
29 })),
30 totalErrors: count("error"),
31 totalWarnings: count("warning"),
32 totalInfos: count("info"),
33 };
34}
35
36describe("formatLintFindings", () => {
37 it("returns no lines when no file has findings", () => {

Callers 1

lintFormat.test.tsFile · 0.85

Calls 1

countFunction · 0.85

Tested by

no test coverage detected