diff --git a/lib/run.js b/lib/run.js index 57b3c87..6e4e1d2 100644 --- a/lib/run.js +++ b/lib/run.js @@ -75,6 +75,10 @@ const annotationLevels = { error: "failure" }; +function summarize({ duration, error, info, warning }) { + return `linting took ${duration}ms, errors: ${error}, warnings: ${warning}, info: ${info}`; +} + async function run() { const id = await createCheck(); try { @@ -94,14 +98,14 @@ async function run() { } await updateCheck(id, 'in-progress', { title: checkName, - summary: `linting took ${stdout.summary.duration}ms, errors: ${stdout.summary.error}, warnings: ${stdout.summary.warning}, info: ${stdout.summary.info}`, + summary: summarize(stdout.summary), annotations }); } - console.log(`clj-kondo detects some problems and exited with a non-zero code (${exitCode}). Please check founded problems at https://github.com/${GITHUB_REPOSITORY}/runs/${id}`); + console.log(`clj-kondo exited with a non-zero code (${exitCode}). Please find your report at https://github.com/${GITHUB_REPOSITORY}/runs/${id}`); await updateCheck(id, 'failure', { title: checkName, - summary: `linting took ${stdout.summary.duration}ms, errors: ${stdout.summary.error}, warnings: ${stdout.summary.warning}, info: ${stdout.summary.info}`, + summary: summarize(stdout.summary), }); process.exit(78); } else if (exitCode == 0) {