Added -fix-errors option to allow applying fixes when compiler errors
are present. Without this flag -fix would bail out if there are compiler errors.
This is needed to avoid applying wrong fixes if Clang fails to recover from
compilation errors correctly.
Details
Diff Detail
Event Timeline
clang-tidy/tool/ClangTidyMain.cpp | ||
---|---|---|
295–299 | It seems strange to first have to compute DisableFixes based on FixErrors, and then use FixErrors again. |
Make the relation between -fix-errors and -fix more explicit. Slightly changed error messages.
clang-tidy/tool/ClangTidyMain.cpp | ||
---|---|---|
300–301 | Why don't we directly do llvm::errs() ...; here and skip the rest of the function (perhaps apart from the stat printing and profile checking)? |
clang-tidy/tool/ClangTidyMain.cpp | ||
---|---|---|
300–301 | We need to call handleErrors to display the errors in any case. We also need to print the stats and profile data, and only then the message that fixes had not been applied. |
lg
clang-tidy/tool/ClangTidyMain.cpp | ||
---|---|---|
300–301 | Ok, then I'd optionally do Fix && !DisableFixes below instead of using the flag like a global variable... |
clang-tidy/tool/ClangTidyMain.cpp | ||
---|---|---|
300–301 | Done. Committed. |
It seems strange to first have to compute DisableFixes based on FixErrors, and then use FixErrors again.
If we want FixErrors to imply Fix, why not have the if (FixErrors) Fix = true; before the whole block?