aislop 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
- import { t as ENGINE_INFO } from "./engine-info-DCvIfZ0f.js";
2
- import { t as APP_VERSION } from "./version-rlhQD8Qh.js";
1
+ import { n as withFindingAssessments, r as ENGINE_INFO, t as summarizeFindingAssessments } from "./finding-assessment-PCl1fnok.js";
2
+ import { t as APP_VERSION } from "./version-BJA3AcRM.js";
3
3
 
4
4
  //#region src/output/json.ts
5
- const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs) => {
5
+ const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs, coverage) => {
6
6
  const allDiagnostics = results.flatMap((r) => r.diagnostics);
7
+ const assessedDiagnostics = withFindingAssessments(allDiagnostics);
7
8
  const engines = {};
8
9
  for (const result of results) engines[result.engine] = {
9
10
  issues: result.diagnostics.length,
@@ -14,11 +15,14 @@ const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs) => {
14
15
  schemaVersion: "1",
15
16
  cliVersion: APP_VERSION,
16
17
  version: APP_VERSION,
17
- score: scoreResult.score,
18
- label: scoreResult.label,
18
+ score: coverage.scoreable ? scoreResult.score : null,
19
+ label: coverage.scoreable ? scoreResult.label : "not scored",
20
+ scoreable: coverage.scoreable,
21
+ coverage,
19
22
  engines,
20
23
  engineDefinitions: ENGINE_INFO,
21
- diagnostics: allDiagnostics,
24
+ diagnostics: assessedDiagnostics,
25
+ findingAssessment: summarizeFindingAssessments(allDiagnostics),
22
26
  summary: {
23
27
  errors: allDiagnostics.filter((d) => d.severity === "error").length,
24
28
  warnings: allDiagnostics.filter((d) => d.severity === "warning").length,
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { r as APP_VERSION, t as ENGINE_INFO } from "./cli.js";
2
+ import { a as APP_VERSION, n as withFindingAssessments, r as ENGINE_INFO, t as summarizeFindingAssessments } from "./cli.js";
3
3
 
4
4
  //#region src/output/json.ts
5
- const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs) => {
5
+ const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs, coverage) => {
6
6
  const allDiagnostics = results.flatMap((r) => r.diagnostics);
7
+ const assessedDiagnostics = withFindingAssessments(allDiagnostics);
7
8
  const engines = {};
8
9
  for (const result of results) engines[result.engine] = {
9
10
  issues: result.diagnostics.length,
@@ -14,11 +15,14 @@ const buildJsonOutput = (results, scoreResult, fileCount, elapsedMs) => {
14
15
  schemaVersion: "1",
15
16
  cliVersion: APP_VERSION,
16
17
  version: APP_VERSION,
17
- score: scoreResult.score,
18
- label: scoreResult.label,
18
+ score: coverage.scoreable ? scoreResult.score : null,
19
+ label: coverage.scoreable ? scoreResult.label : "not scored",
20
+ scoreable: coverage.scoreable,
21
+ coverage,
19
22
  engines,
20
23
  engineDefinitions: ENGINE_INFO,
21
- diagnostics: allDiagnostics,
24
+ diagnostics: assessedDiagnostics,
25
+ findingAssessment: summarizeFindingAssessments(allDiagnostics),
22
26
  summary: {
23
27
  errors: allDiagnostics.filter((d) => d.severity === "error").length,
24
28
  warnings: allDiagnostics.filter((d) => d.severity === "warning").length,