Skip to content

Commit

Permalink
Ignore dprint error code 14 (DefinitelyTyped#67221)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Oct 27, 2023
1 parent 1b8c26a commit 4f6b027
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,21 @@ for (const files of chunked(allFiles, 50)) {
{ encoding: "utf8", maxBuffer: 100 * 1024 * 1024 },
);
// https://dprint.dev/cli/#exit-codes
if (result.status === 20) {
for (const line of result.stdout.split(/\r?\n/)) {
if (line) {
unformatted.push(path.relative(process.cwd(), line));
switch (result.status) {
case 0:
case 14:
// No change or no files matched
break;
case 20:
for (const line of result.stdout.split(/\r?\n/)) {
if (line) {
unformatted.push(path.relative(process.cwd(), line));
}
}
}
} else if (result.status !== 0) {
dprintErrors.push(result.stderr.trim());
break;
default:
dprintErrors.push(result.stderr.trim());
break;
}
}

Expand Down

0 comments on commit 4f6b027

Please sign in to comment.