Skip to content

Support rustfmt 0.5.0 exit codes. #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2016

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented May 31, 2016

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

gif-keyboard-6579402489401314324

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 rust-lang#68
Closes rust-lang#75
References rust-lang/rustfmt#923
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @chris-morgan (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

fnichol added a commit to fnichol/dotvim that referenced this pull request May 31, 2016
This can be reverted if and when rust-lang/rust.vim#85 is merged (or a
similar fix is incorporated).
@chris-morgan chris-morgan merged commit 57ce076 into rust-lang:master May 31, 2016
@oblitum
Copy link

oblitum commented Aug 13, 2016

#75 is not fixed but this merge closed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vim shows whole file (with "--- More ---" scrolling) when saving :RustFmt pager
4 participants