From 145193d797b921cd45e33df924271f03be0948d2 Mon Sep 17 00:00:00 2001 From: Joshua Feingold Date: Mon, 4 Aug 2025 14:18:15 -0500 Subject: [PATCH] FIX @W-18212468@ Fixed ambiguous HTML text --- .../{html-template-0.0.11.txt => html-template-0.0.12.txt} | 4 +++- .../src/output-formats/results/html-run-results-format.ts | 2 +- .../expectedOutputFiles/multipleViolations.goldfile.html | 4 +++- .../unexpectedEngineErrorViolation.goldfile.html | 4 +++- .../expectedOutputFiles/zeroViolations.goldfile.html | 4 +++- 5 files changed, 13 insertions(+), 5 deletions(-) rename packages/code-analyzer-core/output-templates/{html-template-0.0.11.txt => html-template-0.0.12.txt} (99%) diff --git a/packages/code-analyzer-core/output-templates/html-template-0.0.11.txt b/packages/code-analyzer-core/output-templates/html-template-0.0.12.txt similarity index 99% rename from packages/code-analyzer-core/output-templates/html-template-0.0.11.txt rename to packages/code-analyzer-core/output-templates/html-template-0.0.12.txt index b9a0494a..c5e3e564 100644 --- a/packages/code-analyzer-core/output-templates/html-template-0.0.11.txt +++ b/packages/code-analyzer-core/output-templates/html-template-0.0.12.txt @@ -258,7 +258,9 @@ } updateSummary(data2) { const uniqueFiles = new Set(data2.map((v) => v.file)); - (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), + 0 === data2.length + ? (this.summary.textContent = "Found 0 violations") + : (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), this.violationsTable.classList.toggle("hidden", 0 === data2.length); } updateBoxes(data2) { diff --git a/packages/code-analyzer-core/src/output-formats/results/html-run-results-format.ts b/packages/code-analyzer-core/src/output-formats/results/html-run-results-format.ts index b39ee3aa..1a230ab9 100644 --- a/packages/code-analyzer-core/src/output-formats/results/html-run-results-format.ts +++ b/packages/code-analyzer-core/src/output-formats/results/html-run-results-format.ts @@ -8,7 +8,7 @@ import { toJsonResultsOutput } from "./json-run-results-format"; -const HTML_TEMPLATE_VERSION: string = '0.0.11'; +const HTML_TEMPLATE_VERSION: string = '0.0.12'; const HTML_TEMPLATE_FILE: string = path.resolve(__dirname, '..', '..', '..', 'output-templates', `html-template-${HTML_TEMPLATE_VERSION}.txt`); /** diff --git a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/multipleViolations.goldfile.html b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/multipleViolations.goldfile.html index 86a79c50..d86dae2d 100644 --- a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/multipleViolations.goldfile.html +++ b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/multipleViolations.goldfile.html @@ -258,7 +258,9 @@ } updateSummary(data2) { const uniqueFiles = new Set(data2.map((v) => v.file)); - (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), + 0 === data2.length + ? (this.summary.textContent = "Found 0 violations") + : (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), this.violationsTable.classList.toggle("hidden", 0 === data2.length); } updateBoxes(data2) { diff --git a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/unexpectedEngineErrorViolation.goldfile.html b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/unexpectedEngineErrorViolation.goldfile.html index 65382f28..2f828841 100644 --- a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/unexpectedEngineErrorViolation.goldfile.html +++ b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/unexpectedEngineErrorViolation.goldfile.html @@ -258,7 +258,9 @@ } updateSummary(data2) { const uniqueFiles = new Set(data2.map((v) => v.file)); - (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), + 0 === data2.length + ? (this.summary.textContent = "Found 0 violations") + : (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), this.violationsTable.classList.toggle("hidden", 0 === data2.length); } updateBoxes(data2) { diff --git a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/zeroViolations.goldfile.html b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/zeroViolations.goldfile.html index 7c962274..ecd188bd 100644 --- a/packages/code-analyzer-core/test/test-data/expectedOutputFiles/zeroViolations.goldfile.html +++ b/packages/code-analyzer-core/test/test-data/expectedOutputFiles/zeroViolations.goldfile.html @@ -258,7 +258,9 @@ } updateSummary(data2) { const uniqueFiles = new Set(data2.map((v) => v.file)); - (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), + 0 === data2.length + ? (this.summary.textContent = "Found 0 violations") + : (this.summary.textContent = `Found ${data2.length} violation${1 !== data2.length ? "s" : ""} across ${uniqueFiles.size} file${1 !== uniqueFiles.size ? "s" : ""}`), this.violationsTable.classList.toggle("hidden", 0 === data2.length); } updateBoxes(data2) {