-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: Don't back out changes with --broken-code
#6312
Merged
Merged
Conversation
This file contains 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
r? @ehuss |
LGTM. Looks like a CI failure with 1.28 not having the same fix available. |
This commit updates the behavior of `cargo fix` when the `--broken-code` flag is passed to Cargo. Previously Cargo would always back out automatically applied changes to files whenever the fixed code failed to compile. Now, with the `--broken-code` flag, fixed code is left as-is. This means that if the fixed code can be more easily inspected by humans to detect bugs and such. The main use case intended here is that if you're working with a large code base then lints like the edition idiom lints aren't 100% finished yet to work as smoothly as `cargo fix`. The idiom lints are often useful, however, to transition code to be idiomatic (who would have guessed!) in the new edition. To ease the experience of using not-quite-ready lints this flag can be used to hopefully "fix 90% of lint warnings" and then the remaining compiler errors can be sifted through manually. The intention is that we have edition documentation indicating this workflow which also encourages filing bugs for anything that fails to fix, and hopefully this new behavior will make it easier for us to narrow down what the minimal test case is too!
alexcrichton
force-pushed
the
fix-broken
branch
from
November 14, 2018 04:27
36c01c1
to
08dc6da
Compare
@bors: r=ehuss |
📌 Commit 08dc6da has been approved by |
bors
added a commit
that referenced
this pull request
Nov 14, 2018
fix: Don't back out changes with `--broken-code` This commit updates the behavior of `cargo fix` when the `--broken-code` flag is passed to Cargo. Previously Cargo would always back out automatically applied changes to files whenever the fixed code failed to compile. Now, with the `--broken-code` flag, fixed code is left as-is. This means that if the fixed code can be more easily inspected by humans to detect bugs and such. The main use case intended here is that if you're working with a large code base then lints like the edition idiom lints aren't 100% finished yet to work as smoothly as `cargo fix`. The idiom lints are often useful, however, to transition code to be idiomatic (who would have guessed!) in the new edition. To ease the experience of using not-quite-ready lints this flag can be used to hopefully "fix 90% of lint warnings" and then the remaining compiler errors can be sifted through manually. The intention is that we have edition documentation indicating this workflow which also encourages filing bugs for anything that fails to fix, and hopefully this new behavior will make it easier for us to narrow down what the minimal test case is too!
☀️ Test successful - status-appveyor, status-travis |
Nice! Seems very useful to have. |
bors
added a commit
that referenced
this pull request
Nov 14, 2018
[beta] fix: Don't back out changes with `--broken-code` This is a beta backport of #6312
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Nov 14, 2018
Bring in rust-lang/cargo#6312 to the edition release! Closes rust-lang#55954
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Nov 15, 2018
[beta]: Update Cargo submodule Bring in rust-lang/cargo#6312 to the edition release! Closes #55954
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.
This commit updates the behavior of
cargo fix
when the--broken-code
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the
--broken-code
flag, fixed code is left as-is.This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.
The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as
cargo fix
. The idiom lints are oftenuseful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.
To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!