Skip to content

Commit

Permalink
More lenient with rustfmt warnings. Fixes RustDT#144
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Dec 16, 2016
1 parent d668e9e commit 920d1ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#TODO
* Added syntax coloring support for `?` operator.
* Invoking a build operation for a project now immediately cancels the pending build operation for that project, if any.
* More lenient with `rustfmt` exit code 3, don't treat those warnings as a failure. (#144)

### 0.7.0
* Added support for Rust 1.12 new error message format. (#130)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ public String executeToolOperation(IOperationMonitor om)
protected String handleResult(ExternalProcessResult result) throws CommonException, OperationSoftFailure {
int exitValue = result.exitValue;

if(exitValue == 3) {
// Some warnings were generated, but `rustfmt` did complete, so use the result
// TODO: we could display the warnings in a non-modal notification UI
// or even as warning markers?
} else
if(exitValue != 0) {
throw new OperationSoftFailure("`rustfmt` did not complete successfully, exit code: " + exitValue + "\n" +
result.getStdErrBytes().toUtf8String());
String msg = "`rustfmt` did not complete successfully, exit code: " + exitValue + "\n" +
result.getStdErrBytes().toUtf8String();
throw new OperationSoftFailure(msg);
}

// formatted file is in stdout
Expand Down

0 comments on commit 920d1ae

Please sign in to comment.