Skip to content

Commit

Permalink
chore: test without columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Codex- committed Oct 31, 2023
1 parent b62d2fc commit 5c0c84e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
15 changes: 9 additions & 6 deletions dist/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/__snapshots__/api.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export async function createCheck(name: string, title: string): Promise<CreateCh
status: "in_progress",
output: {
title: title,
summary: "Starting...",
summary: "",
},
});

Expand Down
25 changes: 13 additions & 12 deletions src/tasks/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@ export async function updateCheckAnnotations(
`[updateCheckAnnotations]: Slicing ${i}...${i + (CHECK_ANNOTATIONS_UPDATE_LIMIT - 1)}`,
);

const slice = minimalAnnotations
.slice(i, i + CHECK_ANNOTATIONS_UPDATE_LIMIT)
.map((minimalAnnotation) => {
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,
});

Expand Down

0 comments on commit 5c0c84e

Please sign in to comment.