From 33dba3ca8b7e40d39dd886a107a2df6bfe3be976 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:08:47 +0200 Subject: [PATCH 01/10] fix: refine file check output formatting Updated output messages to provide detailed summaries, including counts of files with issues or cleaned files. Improved clarity and consistency in the display of file check results. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- src/lib/output.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lib/output.js b/src/lib/output.js index f3fd68c..baaf6b2 100644 --- a/src/lib/output.js +++ b/src/lib/output.js @@ -51,8 +51,12 @@ export function formatValidationResult(result, quiet = false) { } } - if (!quiet && cleanCount > 0) { - lines.push(` ${s.success(`${cleanCount} ${cleanCount === 1 ? 'file' : 'files'}: no issues`)}`); + if (!quiet && result.files.length > 0) { + const total = result.files.length; + const parts = []; + if (withIssues.length > 0) parts.push(s.warning(`${withIssues.length} with issues`)); + if (cleanCount > 0) parts.push(s.success(`${cleanCount} clean`)); + lines.push(`\n ${total} ${total === 1 ? 'file' : 'files'} checked · ${parts.join(', ')}`); } return lines.join('\n'); @@ -84,8 +88,12 @@ export function formatDeprecationResult(result, quiet = false) { } } - if (!quiet && cleanCount > 0) { - lines.push(` ${s.success(`${cleanCount} ${cleanCount === 1 ? 'file' : 'files'}: no issues`)}`); + if (!quiet && result.files.length > 0) { + const total = result.files.length; + const parts = []; + if (withIssues.length > 0) parts.push(s.warning(`${withIssues.length} with issues`)); + if (cleanCount > 0) parts.push(s.success(`${cleanCount} clean`)); + lines.push(`\n ${total} ${total === 1 ? 'file' : 'files'} checked · ${parts.join(', ')}`); } return lines.join('\n'); @@ -160,7 +168,7 @@ export function formatLinkCheckResult(result, quiet = false) { : ''; const summaryBroken = result.countBroken === 0 && result.countFileErrors === 0 ? s.success('no broken links') - : s.warning(`${result.countBroken} broken`); + : s.warning(`${result.countBroken} broken ${result.countBroken === 1 ? 'link' : 'links'}`); lines.push(`\n ${result.files.length} ${result.files.length === 1 ? 'file' : 'files'} · ${summaryCount}${summarySkipped}${summaryFileErrors} · ${summaryBroken}`); From 405ff28c953b18dc346a520cec949236de44d29d Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:09:12 +0200 Subject: [PATCH 02/10] docs: add 1.3.1-beta note on improved summaries Signed-off-by: Jens Oliver Meiert --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70eb58a..e112838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to hihtml are documented in this file, which is (mostly) AI- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.1-beta] - 2026-05-14 + +### Changed + +* Extended end-of-section output summary for validation and deprecated markup checks + ## [1.3.0-beta] - 2026-05-13 ### Added From b7840572d857ed18d75875061a39f2ce15b48ad7 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:09:32 +0200 Subject: [PATCH 03/10] chore: bump version Signed-off-by: Jens Oliver Meiert --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22e7303..486e7d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hihtml", - "version": "1.3.0-beta", + "version": "1.3.1-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hihtml", - "version": "1.3.0-beta", + "version": "1.3.1-beta", "license": "MIT", "dependencies": { "commander": "^14.0.3", diff --git a/package.json b/package.json index 2df0313..ee97955 100644 --- a/package.json +++ b/package.json @@ -55,5 +55,5 @@ }, "type": "module", "types": "src/index.d.ts", - "version": "1.3.0-beta" + "version": "1.3.1-beta" } From 6643999712e0423decd558f4752de190e74d0e1a Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:18:44 +0200 Subject: [PATCH 04/10] refactor: streamline file summary generation Replaced repetitive file summary logic with reusable helper functions (`filesCount` and `filesSummary`). This improves code readability, reduces redundancy, and ensures consistent output formatting across all file validation and reporting functions. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- src/lib/output.js | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/lib/output.js b/src/lib/output.js index baaf6b2..54ceb86 100644 --- a/src/lib/output.js +++ b/src/lib/output.js @@ -19,7 +19,6 @@ export { s as style }; */ export function formatValidationResult(result, quiet = false) { const withIssues = result.files.filter(f => f.messages.length > 0); - const cleanCount = result.files.length - withIssues.length; if (quiet && result.countErrors === 0 && result.countWarnings === 0) { if (result.countIgnored > 0) @@ -51,13 +50,8 @@ export function formatValidationResult(result, quiet = false) { } } - if (!quiet && result.files.length > 0) { - const total = result.files.length; - const parts = []; - if (withIssues.length > 0) parts.push(s.warning(`${withIssues.length} with issues`)); - if (cleanCount > 0) parts.push(s.success(`${cleanCount} clean`)); - lines.push(`\n ${total} ${total === 1 ? 'file' : 'files'} checked · ${parts.join(', ')}`); - } + if (!quiet && result.files.length > 0) + lines.push(filesSummary(result.files.length, withIssues.length, 'validated')); return lines.join('\n'); } @@ -69,7 +63,6 @@ export function formatValidationResult(result, quiet = false) { */ export function formatDeprecationResult(result, quiet = false) { const withIssues = result.files.filter(f => f.error || f.elements.length > 0 || f.attributes.length > 0); - const cleanCount = result.files.length - withIssues.length; if (quiet && withIssues.length === 0) return ''; @@ -88,13 +81,8 @@ export function formatDeprecationResult(result, quiet = false) { } } - if (!quiet && result.files.length > 0) { - const total = result.files.length; - const parts = []; - if (withIssues.length > 0) parts.push(s.warning(`${withIssues.length} with issues`)); - if (cleanCount > 0) parts.push(s.success(`${cleanCount} clean`)); - lines.push(`\n ${total} ${total === 1 ? 'file' : 'files'} checked · ${parts.join(', ')}`); - } + if (!quiet && result.files.length > 0) + lines.push(filesSummary(result.files.length, withIssues.length, 'checked for deprecated markup')); return lines.join('\n'); } @@ -151,7 +139,7 @@ export function formatLinkCheckResult(result, quiet = false) { } if (!quiet && cleanCount > 0 && (withIssues.length > 0 || result.countChecked > 0 || result.countSkipped > 0)) { - lines.push(` ${s.success(`${cleanCount} ${cleanCount === 1 ? 'file' : 'files'}: no issues`)}`); + lines.push(` ${s.success(`${filesCount(cleanCount)}: no issues`)}`); } const total = result.countChecked; @@ -170,7 +158,7 @@ export function formatLinkCheckResult(result, quiet = false) { ? s.success('no broken links') : s.warning(`${result.countBroken} broken ${result.countBroken === 1 ? 'link' : 'links'}`); - lines.push(`\n ${result.files.length} ${result.files.length === 1 ? 'file' : 'files'} · ${summaryCount}${summarySkipped}${summaryFileErrors} · ${summaryBroken}`); + lines.push(`\n ${filesCount(result.files.length)} · ${summaryCount}${summarySkipped}${summaryFileErrors} · ${summaryBroken}`); return lines.join('\n'); } @@ -197,12 +185,23 @@ export function formatMinificationResult(result, quiet = false) { if (!quiet) { const successCount = result.files.filter(f => !f.error).length; - lines.push(`\n ${s.success(`${successCount} ${successCount === 1 ? 'file' : 'files'} minified, ${formatBytes(saved)} saved`)}`); + lines.push(`\n ${s.success(`${filesCount(successCount)} minified, ${formatBytes(saved)} saved`)}`); } return lines.join('\n'); } +/** @param {number} n @returns {string} */ +function filesCount(n) { return `${n} ${n === 1 ? 'file' : 'files'}`; } + +/** @param {number} total @param {number} issueCount @param {string} label @returns {string} */ +function filesSummary(total, issueCount, label) { + const parts = []; + if (issueCount > 0) parts.push(s.warning(`${issueCount} with issues`)); + if (total - issueCount > 0) parts.push(s.success(`${total - issueCount} clean`)); + return `\n ${filesCount(total)} ${label} · ${parts.join(', ')}`; +} + /** @param {number} bytes @returns {string} */ function formatBytes(bytes) { if (bytes < 1024) return `${bytes} B`; From 3b6cb04082b42af33f0df1bf47abee119a01a1ee Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:34:37 +0200 Subject: [PATCH 05/10] refactor: enhance output generation and add section numbering Revised the output generation logic to consolidate sections into arrays, ensuring cleaner and more modular handling of outputs. Added functionality to number sections when multiple are displayed, improving readability and clarity in reports. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- bin/hihtml.js | 24 ++++++++++++++++++------ bin/hihtml.test.js | 21 +++++++++++++++++++++ src/lib/output.js | 9 ++++----- 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/bin/hihtml.js b/bin/hihtml.js index 1444bb2..5439e9c 100755 --- a/bin/hihtml.js +++ b/bin/hihtml.js @@ -132,9 +132,19 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { readProg.complete(); } - let quietHadOutput = false; + const sections = []; + const printSections = () => { + const numbered = sections.length > 1; + sections.forEach((out, i) => { + if (!numbered) { console.log('\n' + out); return; } + const num = `${i + 1}. `; + const withTitle = num + out; + const withSummary = withTitle.replace(/(\n {2})([^\n]+)$/, `$1${num}$2`); + console.log('\n' + withSummary); + }); + }; const showQuietHint = () => { - if (opts.quiet && quietHadOutput) console.log('\n(Use `-r` for a full report, or run without `-q` for inline output.)'); + if (opts.quiet && sections.length > 0) console.log('\n(Use `-r` for a full report, or run without `-q` for inline output)'); }; /** @type {import('../src/adapters/check-code.js').CheckResult | undefined} */ @@ -151,9 +161,9 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { ); const valOut = formatValidationResult(checkResult.validation, opts.quiet); - if (valOut) { console.log('\n' + valOut); quietHadOutput = true; } + if (valOut) sections.push(valOut); const depOut = formatDeprecationResult(checkResult.deprecation, opts.quiet); - if (depOut) { console.log('\n' + depOut); quietHadOutput = true; } + if (depOut) sections.push(depOut); report.results.checkCode = checkResult; } @@ -176,11 +186,12 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { ); const linkOut = formatLinkCheckResult(linkResult, opts.quiet); - if (linkOut) { console.log('\n' + linkOut); quietHadOutput = true; } + if (linkOut) sections.push(linkOut); report.results.links = linkResult; } if (opts.all && checkResult?.validation.countErrors > 0) { + printSections(); console.error( '\n' + style.error(`${checkResult.validation.countErrors} validation ${checkResult.validation.countErrors === 1 ? 'error' : 'errors'} found—skipping minification`) + '\n' + '(Fix validation issues first or define HTML-validate rule IDs to ignore)' @@ -220,10 +231,11 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { minifyProg.complete(minifyResult.files.some(f => f.error)); const minOut = formatMinificationResult(minifyResult, opts.quiet); - if (minOut) { console.log('\n' + minOut); quietHadOutput = true; } + if (minOut) sections.push(minOut); report.results.minify = minifyResult; } + printSections(); if (opts.report !== undefined) await saveReport(report, opts.report); const hasErrors = (report.results.checkCode?.validation.countErrors ?? 0) > 0 diff --git a/bin/hihtml.test.js b/bin/hihtml.test.js index d03ec90..c3f22ba 100644 --- a/bin/hihtml.test.js +++ b/bin/hihtml.test.js @@ -217,6 +217,12 @@ describe('CLI `--check-code`', () => { const { stdout } = run(['-i', path.join(tempDir, 'clean.html')]); assert.ok(stdout.includes('Validation')); }); + + test('Numbers sections when multiple are shown', () => { + const { stdout } = run(['-c', '-i', path.join(tempDir, 'clean.html')]); + assert.ok(stdout.includes('1. ')); + assert.ok(stdout.includes('2. ')); + }); }); // CLI: Check links @@ -308,6 +314,11 @@ describe('CLI `--check-links`', () => { assert.strictEqual(report.command, 'check-code+check-links'); fs.unlinkSync(reportPath); }); + + test('Does not number section when only one check is shown', () => { + const { stdout } = run(['-l', '-i', path.join(tempDir, 'links_none.html')]); + assert.ok(!stdout.includes('1. ')); + }); }); // CLI: Minify @@ -380,6 +391,16 @@ describe('CLI `--all`', () => { fs.rmSync(ignoreDir, { recursive: true, force: true }); fs.rmSync(outDir, { recursive: true, force: true }); + + test('Numbers all sections', () => { + const outDir = path.join(tempDir, 'all_numbered_out'); + const { stdout } = run(['-a', '-i', path.join(tempDir, 'clean.html'), '-o', outDir]); + assert.ok(stdout.includes('1. ')); + assert.ok(stdout.includes('2. ')); + assert.ok(stdout.includes('3. ')); + assert.ok(stdout.includes('4. ')); + fs.rmSync(outDir, { recursive: true, force: true }); + }); }); test('Runs check and minify and exits “0” when only deprecated markup is found (no validation errors)', () => { diff --git a/src/lib/output.js b/src/lib/output.js index 54ceb86..4b76525 100644 --- a/src/lib/output.js +++ b/src/lib/output.js @@ -138,10 +138,6 @@ export function formatLinkCheckResult(result, quiet = false) { } } - if (!quiet && cleanCount > 0 && (withIssues.length > 0 || result.countChecked > 0 || result.countSkipped > 0)) { - lines.push(` ${s.success(`${filesCount(cleanCount)}: no issues`)}`); - } - const total = result.countChecked; const summaryCount = total === 0 && result.countSkipped === 0 ? 'no http/https links' @@ -154,11 +150,14 @@ export function formatLinkCheckResult(result, quiet = false) { const summaryFileErrors = result.countFileErrors > 0 ? `, ${s.error(`${result.countFileErrors} file ${result.countFileErrors === 1 ? 'error' : 'errors'}`)}` : ''; + const fileParts = []; + if (withIssues.length > 0) fileParts.push(s.warning(`${withIssues.length} with issues`)); + if (cleanCount > 0) fileParts.push(s.success(`${cleanCount} clean`)); const summaryBroken = result.countBroken === 0 && result.countFileErrors === 0 ? s.success('no broken links') : s.warning(`${result.countBroken} broken ${result.countBroken === 1 ? 'link' : 'links'}`); - lines.push(`\n ${filesCount(result.files.length)} · ${summaryCount}${summarySkipped}${summaryFileErrors} · ${summaryBroken}`); + lines.push(`\n ${filesCount(result.files.length)} · ${summaryCount}${summarySkipped}${summaryFileErrors} · ${fileParts.join(', ')} · ${summaryBroken}`); return lines.join('\n'); } From 07d9df043e408a3b5cf8de340be6bad94379cd61 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:39:14 +0200 Subject: [PATCH 06/10] fix: correct summary regex for title formatting Adjusted the regex in the output formatting logic to account for cases with double newlines before summaries. This ensures consistent handling of titles and summaries, improving overall output clarity. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- bin/hihtml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hihtml.js b/bin/hihtml.js index 5439e9c..5df1733 100755 --- a/bin/hihtml.js +++ b/bin/hihtml.js @@ -139,7 +139,7 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { if (!numbered) { console.log('\n' + out); return; } const num = `${i + 1}. `; const withTitle = num + out; - const withSummary = withTitle.replace(/(\n {2})([^\n]+)$/, `$1${num}$2`); + const withSummary = withTitle.replace(/\n(\n {2})([^\n]+)$/, `\n$1${num}$2`); console.log('\n' + withSummary); }); }; From aa156758e8ce28dc305690415146538c9b0ac632 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:39:45 +0200 Subject: [PATCH 07/10] docs: extend changelog notes for 1.3.1-beta Signed-off-by: Jens Oliver Meiert --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e112838..081edd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Changed -* Extended end-of-section output summary for validation and deprecated markup checks +* Improved end-of-section summaries across all check types: + - Validation and deprecated markup sections now end with a line like “30 files validated · 17 with issues, 13 clean” (previously only the clean-file count was shown) + - Link check summary now includes the per-file breakdown (e.g., “19 with issues, 11 clean”) inline, replacing the separate floating “_x_ files: no issues” line; also fixed “3 broken” → “3 broken links” +* Numbered output sections when more than one is shown (e.g., “1. Validation”, “2. Deprecated markup”), with the number repeated on the summary line for easier scanning in long output ## [1.3.0-beta] - 2026-05-13 From 124d0a6330bb04111880e324fc8f0808b276f12e Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:52:00 +0200 Subject: [PATCH 08/10] refactor: move section numbering test within suite Relocated the "Numbers all sections" test to follow the correct cleanup logic within the test suite. This improves structure and ensures tests run in the intended sequence without unnecessary duplication. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- bin/hihtml.test.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/hihtml.test.js b/bin/hihtml.test.js index c3f22ba..17b7d49 100644 --- a/bin/hihtml.test.js +++ b/bin/hihtml.test.js @@ -391,16 +391,6 @@ describe('CLI `--all`', () => { fs.rmSync(ignoreDir, { recursive: true, force: true }); fs.rmSync(outDir, { recursive: true, force: true }); - - test('Numbers all sections', () => { - const outDir = path.join(tempDir, 'all_numbered_out'); - const { stdout } = run(['-a', '-i', path.join(tempDir, 'clean.html'), '-o', outDir]); - assert.ok(stdout.includes('1. ')); - assert.ok(stdout.includes('2. ')); - assert.ok(stdout.includes('3. ')); - assert.ok(stdout.includes('4. ')); - fs.rmSync(outDir, { recursive: true, force: true }); - }); }); test('Runs check and minify and exits “0” when only deprecated markup is found (no validation errors)', () => { @@ -417,6 +407,16 @@ describe('CLI `--all`', () => { fs.rmSync(srcDir, { recursive: true, force: true }); fs.rmSync(outDir, { recursive: true, force: true }); }); + + test('Numbers all sections', () => { + const outDir = path.join(tempDir, 'all_numbered_out'); + const { stdout } = run(['-a', '-i', path.join(tempDir, 'clean.html'), '-o', outDir]); + assert.ok(stdout.includes('1. ')); + assert.ok(stdout.includes('2. ')); + assert.ok(stdout.includes('3. ')); + assert.ok(stdout.includes('4. ')); + fs.rmSync(outDir, { recursive: true, force: true }); + }); }); // CLI: Report From 214b362cfe89a008aa6d7b3512397c7e408908ea Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Wed, 13 May 2026 20:52:23 +0200 Subject: [PATCH 09/10] refactor: improve file issue and clean count logic Replaced `cleanCount` with `countClean` and introduced `countIssues` to enhance clarity and consistency in file issue reporting. Updated corresponding output logic for better readability and maintainability. (This commit message was AI-generated.) Signed-off-by: Jens Oliver Meiert --- src/lib/output.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/output.js b/src/lib/output.js index 4b76525..78f95d9 100644 --- a/src/lib/output.js +++ b/src/lib/output.js @@ -96,7 +96,10 @@ export function formatLinkCheckResult(result, quiet = false) { const withIssues = result.files.filter(f => f.error || f.links.some(l => !l.ok || l.skipped || l.warning === 'permanent-redirect') ); - const cleanCount = result.files.length - withIssues.length; + const countIssues = withIssues.filter(f => + f.error || f.links.some(l => !l.ok || l.warning === 'permanent-redirect') + ).length; + const countClean = result.files.length - withIssues.length; const hasRealIssues = result.countBroken > 0 || result.countFileErrors > 0 || result.files.some(f => f.links.some(l => l.warning === 'permanent-redirect')); @@ -151,8 +154,8 @@ export function formatLinkCheckResult(result, quiet = false) { ? `, ${s.error(`${result.countFileErrors} file ${result.countFileErrors === 1 ? 'error' : 'errors'}`)}` : ''; const fileParts = []; - if (withIssues.length > 0) fileParts.push(s.warning(`${withIssues.length} with issues`)); - if (cleanCount > 0) fileParts.push(s.success(`${cleanCount} clean`)); + if (countIssues > 0) fileParts.push(s.warning(`${countIssues} with issues`)); + if (countClean > 0) fileParts.push(s.success(`${countClean} clean`)); const summaryBroken = result.countBroken === 0 && result.countFileErrors === 0 ? s.success('no broken links') : s.warning(`${result.countBroken} broken ${result.countBroken === 1 ? 'link' : 'links'}`); From 1d52305587f1456c54f25a06b3525d6facff8690 Mon Sep 17 00:00:00 2001 From: Jens Oliver Meiert Date: Thu, 14 May 2026 08:46:48 +0200 Subject: [PATCH 10/10] refactor: rename constants Signed-off-by: Jens Oliver Meiert --- bin/hihtml.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/hihtml.js b/bin/hihtml.js index 5df1733..8fe810a 100755 --- a/bin/hihtml.js +++ b/bin/hihtml.js @@ -133,7 +133,7 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { } const sections = []; - const printSections = () => { + const sectionsPrint = () => { const numbered = sections.length > 1; sections.forEach((out, i) => { if (!numbered) { console.log('\n' + out); return; } @@ -143,7 +143,7 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { console.log('\n' + withSummary); }); }; - const showQuietHint = () => { + const quietHint = () => { if (opts.quiet && sections.length > 0) console.log('\n(Use `-r` for a full report, or run without `-q` for inline output)'); }; @@ -191,12 +191,12 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { } if (opts.all && checkResult?.validation.countErrors > 0) { - printSections(); + sectionsPrint(); console.error( '\n' + style.error(`${checkResult.validation.countErrors} validation ${checkResult.validation.countErrors === 1 ? 'error' : 'errors'} found—skipping minification`) + '\n' + '(Fix validation issues first or define HTML-validate rule IDs to ignore)' ); - showQuietHint(); + quietHint(); if (opts.report !== undefined) await saveReport(report, opts.report); process.exit(1); } @@ -235,7 +235,7 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { report.results.minify = minifyResult; } - printSections(); + sectionsPrint(); if (opts.report !== undefined) await saveReport(report, opts.report); const hasErrors = (report.results.checkCode?.validation.countErrors ?? 0) > 0 @@ -243,7 +243,7 @@ function makeProgress(label, total, { leadingNewline = false } = {}) { || (report.results.links?.countFileErrors ?? 0) > 0 || (report.results.minify?.files.some(f => f.error) ?? false); - showQuietHint(); + quietHint(); process.exit(hasErrors ? 1 : 0); } catch (err) {