Support rustfmt 0.5.0 exit codes. #85
Merged
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.
Hello vimers,
This change updates the acceptable exit codes from
rustfmt
when deciding whether or not to write back the file or display the errors location list.As of rust-lang/rustfmt#923,
rustfmt
exits with either a 0, 1, 2, or 3 depending on what happened. Prior to this upstream change,rustfmt
would exit 0 when issues that cannot be automatically resolved would occur. Now, the same errors (such as "line exceeded maximum length") result in an exit of 3 (see the [README](line exceeded maximum length) for more details).This change will treat an exit of 3 as "okay" for writing back as
rustfmt
didn't fail (it just couldn't auto-format a nicer solution).Closes #68
Closes #75
References rust-lang/rustfmt#923