Skip to content

Commit 57f05d1

Browse files
djmccormickJamieMason
authored andcommitted
fix(format): return exit code 0 when formatting files
Format command should always return success exit code (0) when it completes successfully, regardless of whether files needed formatting. Only show "no issues found" message when no formatting was required. Fixes regression introduced in 0d1f602 where format operations would return exit code 1 when files needed formatting.
1 parent 6a10f00 commit 57f05d1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"Chase Holdren (https://github.com/chaseholdren)",
1717
"Chase Tamnoon (https://github.com/chase-tamnoon)",
1818
"Daniel Silva (https://github.com/dsilvasc)",
19+
"Dustin McCormick (https://github.com/djmccormick)",
1920
"Elchin Valiyev (https://github.com/evaliyev)",
2021
"Gabriel Pereira Woitechen (https://github.com/wtchnm)",
2122
"Jamie Haywood (https://github.com/jamiehaywood)",

src/effects/format.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ fn fix_formatting(ctx: Context) -> i32 {
5757
package.borrow().write_to_disk(&ctx.config);
5858
});
5959
}
60-
if was_invalid {
61-
1
62-
} else {
60+
if !was_invalid {
6361
ui::util::print_no_issues_found();
64-
0
6562
}
63+
0
6664
}

0 commit comments

Comments
 (0)