From 5c0c84e04b96bdb551a7d4ff80674e50e343bb43 Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Tue, 31 Oct 2023 14:50:38 +1300 Subject: [PATCH] chore: test without columns --- dist/index.mjs | 15 +++++++++------ src/__snapshots__/api.spec.ts.snap | 2 +- src/api.ts | 2 +- src/tasks/check.ts | 25 +++++++++++++------------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index b80e0c8..1f6da9c 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -22002,7 +22002,7 @@ async function createCheck(name, title) { status: "in_progress", output: { title, - summary: "Starting..." + summary: "" } }); if (response.status !== 201) { @@ -22041,19 +22041,22 @@ async function updateCheckAnnotations(checkId, minimalAnnotations) { core3.debug( `[updateCheckAnnotations]: Slicing ${i}...${i + (CHECK_ANNOTATIONS_UPDATE_LIMIT - 1)}` ); - const slice = minimalAnnotations.slice(i, i + CHECK_ANNOTATIONS_UPDATE_LIMIT).map((minimalAnnotation) => { + const slice = minimalAnnotations.slice(i, i + CHECK_ANNOTATIONS_UPDATE_LIMIT).map((ma) => { const annotation = { - ...minimalAnnotation, - end_line: minimalAnnotation.start_line, + path: ma.path, + start_line: ma.start_line, + end_line: ma.start_line, + // start_column: ma.start_column, + // end_column: ma.start_column + ma.identifier.length, annotation_level: "failure", - message: `\`${minimalAnnotation.identifier}\` is unused` + message: `\`${ma.identifier}\` is unused` }; return annotation; }); core3.debug(`[updateCheckAnnotations]: Updating check ${checkId}`); await updateCheck(checkId, "in_progress", { title: "Knip reporter analysis", - summary: "Updating annotations...", + summary: "", annotations: slice }); i += CHECK_ANNOTATIONS_UPDATE_LIMIT; diff --git a/src/__snapshots__/api.spec.ts.snap b/src/__snapshots__/api.spec.ts.snap index 514afdb..62e4e63 100644 --- a/src/__snapshots__/api.spec.ts.snap +++ b/src/__snapshots__/api.spec.ts.snap @@ -8,7 +8,7 @@ exports[`API > createCheck > should not throw 1`] = ` "head_sha": "12345678", "name": "knip-reporter", "output": { - "summary": "Starting...", + "summary": "", "title": "Knip reporter analysis", }, "owner": "a", diff --git a/src/api.ts b/src/api.ts index 6be1c56..aa8f1f3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -127,7 +127,7 @@ export async function createCheck(name: string, title: string): Promise { - const annotation: Annotation = { - ...minimalAnnotation, - end_line: minimalAnnotation.start_line, - annotation_level: "failure", - message: `\`${minimalAnnotation.identifier}\` is unused`, - }; - return annotation; - }); + const slice = minimalAnnotations.slice(i, i + CHECK_ANNOTATIONS_UPDATE_LIMIT).map((ma) => { + const annotation: Annotation = { + path: ma.path, + start_line: ma.start_line, + end_line: ma.start_line, + // start_column: ma.start_column, + // end_column: ma.start_column + ma.identifier.length, + annotation_level: "failure", + message: `\`${ma.identifier}\` is unused`, + }; + return annotation; + }); core.debug(`[updateCheckAnnotations]: Updating check ${checkId}`); await updateCheck(checkId, "in_progress", { title: "Knip reporter analysis", - summary: "Updating annotations...", + summary: "", annotations: slice, });