Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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}`);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lighter touch change here of something like:

clj-kondo detected some problems and exited with a non-zero code (n). Please check the problems found at https://github.com/...

I shortened things because I'm a sucker for something succinct.

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) {
Expand Down