Update string format output by formatLintResults to match markdownlint-cli2 (and markdownlint-cli).
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run

This commit is contained in:
David Anson 2025-09-09 21:07:18 -07:00
parent fe0543f4b9
commit 480958352e
8 changed files with 886 additions and 887 deletions

View file

@ -660,17 +660,15 @@ module.exports.formatLintResults = function formatLintResults(lintResults) {
entries.sort((a, b) => a[0].localeCompare(b[0]));
for (const [ source, lintErrors ] of entries) {
for (const lintError of lintErrors) {
results.push(
source + ": " +
lintError.lineNumber + ": " +
lintError.ruleNames.join("/") + " " +
lintError.ruleDescription +
(lintError.errorDetail ?
" [" + lintError.errorDetail + "]" :
"") +
(lintError.errorContext ?
" [Context: \"" + lintError.errorContext + "\"]" :
""));
const { lineNumber, ruleNames, ruleDescription, errorDetail, errorContext, errorRange } = lintError;
const rule = ruleNames.join("/");
const line = `:${lineNumber}`;
const rangeStart = (errorRange && errorRange[0]) || 0;
const column = rangeStart ? `:${rangeStart}` : "";
const description = ruleDescription;
const detail = (errorDetail ? ` [${errorDetail}]` : "");
const context = (errorContext ? ` [Context: "${errorContext}"]` : "");
results.push(`${source}${line}${column} ${rule} ${description}${detail}${context}`);
}
}
return results;