Skip to content

Commit e8414e3

Browse files
committed
Build
1 parent e5971c2 commit e8414e3

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

Diff for: run/dist/index.js

+8-15
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,11 @@ async function run() {
342342
const patches = (0, patch_1.parsePatches)(patch);
343343
const ps = (0, suggestions_1.getSuggestions)(bases, patches, resolved).map((s) => {
344344
if (s.skipReason) {
345-
core.warning(`Skipping suggestion: ${s.skipReason}`);
345+
const line = s.startLine !== s.endLine
346+
? `${s.startLine}-${s.endLine}`
347+
: `${s.startLine}`;
348+
const location = `${s.path}:${line}`;
349+
core.warning(`[${location}]: Skipping suggestion: ${s.skipReason}`);
346350
return Promise.resolve();
347351
}
348352
else {
@@ -896,19 +900,8 @@ function getSuggestions(bases, patches, resolved) {
896900
const adds = new hunk_1.Hunks(file.modifiedLines.filter((x) => x.added));
897901
dels.forEach((del) => {
898902
const line = NE.head(del).lineNumber;
899-
const location = `${file.afterName}:${line}`;
900903
const add = adds.get(line);
901-
const mkSkipped = (message, omitLineDetails) => {
902-
const lineDetails = omitLineDetails
903-
? []
904-
: [
905-
`Lines added in PR diff: ${JSON.stringify(baseAdds.lines())}`,
906-
`Lines deleted in Restyled diff: ${JSON.stringify(dels.lines())}`,
907-
`Lines added in Restyled diff: ${JSON.stringify(adds.lines())}`,
908-
];
909-
const skipReason = [`[${location}] ${message}`]
910-
.concat(lineDetails)
911-
.join("\n");
904+
const mkSkipped = (skipReason) => {
912905
return {
913906
path: file.afterName,
914907
description: (patch.message || "").replace(/^\[PATCH] /, ""),
@@ -926,11 +919,11 @@ function getSuggestions(bases, patches, resolved) {
926919
code: add ? NE.toList(add).map((x) => x.line) : [],
927920
};
928921
if (!baseAdds.contain(del)) {
929-
suggestions.push(mkSkipped(`Suggestions can only be made on added lines`));
922+
suggestions.push(mkSkipped(`suggestions can only be made on added lines`));
930923
return;
931924
}
932925
if (resolved.some((r) => isSameLocation(r, suggestion))) {
933-
suggestions.push(mkSkipped(`Suggestion already marked resolved`, true));
926+
suggestions.push(mkSkipped(`previously marked resolved`));
934927
return;
935928
}
936929
suggestions.push(suggestion);

0 commit comments

Comments
 (0)