fix(format): return exit code 0 when formatting files#301
Closed
djmccormick wants to merge 1 commit intoJamieMason:mainfrom
Closed
fix(format): return exit code 0 when formatting files#301djmccormick wants to merge 1 commit intoJamieMason:mainfrom
djmccormick wants to merge 1 commit intoJamieMason:mainfrom
Conversation
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.
Owner
|
Thanks, this is released in 14.0.0-alpha.20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #300
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.
Description (What)
This change fixes the exit code behavior of the
syncpack formatcommand. The format command now always returns exit code 0 when it completes successfully, and only displays the "no issues found" message when no formatting changes were actually needed.The fix modifies the
fix_formattingfunction insrc/effects/format.rsto:!was_invalid(no formatting was needed)Justification (Why)
The format command is designed to fix formatting issues, not to fail when formatting is needed. Returning exit code 1 when files need formatting breaks CI/CD pipelines and scripts that expect the format command to succeed after making necessary changes.
This was a regression introduced in commit 0d1f602 during a refactor that changed from
std::process::exit()to returning exit codes. The logic for the format operation incorrectly adopted the same exit code behavior as the check operation, but format operations should always succeed when they complete.How Can This Be Tested?
syncpack format --source package.json