Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 34671d3

Browse files
committed
Apply suggestions from code review
1 parent 78e3d76 commit 34671d3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/pr-info.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,18 +414,12 @@ function makeJsonCheckerFromCore(requiredForm: any, ignoredKeys: string[]) {
414414
const newDiff = diffFromReq(contents);
415415
if (typeof newDiff === "string") return newDiff;
416416
if (newDiff.length === 0) return undefined;
417-
if (!oldText) return `not the required form
418-
\`\`\`JSON
419-
${JSON.stringify(newDiff)}
420-
\`\`\``;
417+
if (!oldText) return `not the required form \`${JSON.stringify(newDiff)}\``;
421418
const oldDiff = diffFromReq(oldText);
422419
if (typeof oldDiff === "string") return oldDiff;
423420
const notRemove = jsonDiff.compare(oldDiff, newDiff).filter(({ op }) => op !== "remove");
424421
if (notRemove.length === 0) return undefined;
425-
return `not the required form and not moving towards it
426-
\`\`\`JSON
427-
${JSON.stringify(notRemove.map(({ path }) => newDiff[Number(path.slice(1))]))}
428-
\`\`\``;
422+
return `not the required form and not moving towards it \`${JSON.stringify(notRemove.map(({ path }) => newDiff[Number(path.slice(1))]))}\``;
429423
};
430424
}
431425

0 commit comments

Comments
 (0)