Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option.
Update clang-apply-replacements to handle the new format.
Follow-up to D16183
Differential D26137
[clang-tidy] Add check name to YAML export Alpha on Oct 31 2016, 3:15 AM. Authored by
Details
Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option. Follow-up to D16183
Diff Detail
Event TimelineComment Actions Thank you for resurrecting this patch! A few comments inline.
Comment Actions Export effectively MainSourceFile. Comment Actions What happens to diagnostics without fixes? e.g. from the readability-function-size check. Comment Actions This shouldn't affect diagnostics without fixes. If there is no fix, there won't be anything to export, and the diagnostic just behaves normally. Comment Actions This is not the aim of this change-set. The objective here is only to associate a replacement to the diagnostic from which it was emitted. But having a parse-able output for all clang-tidy's diagnostics can indeed be a nice feature to add in a different patch. Comment Actions Looks mostly good. A few more nits.
Comment Actions LG with a comment.
Comment Actions Do you have commit access? If you need me to commit the patch for you, please rebase it on top of HEAD. Comment Actions The patch spans two repos, so I couldn't apply it using arcanist. Just made it "manually" (patch -p0 -i ...); now running tests... Comment Actions Looks like compiler has found a couple of bugs: In file included from llvm.git/tools/clang/tools/extra/clang-tidy/ClangTidy.cpp:38: llvm.git/tools/clang/include/clang/Tooling/DiagnosticsYaml.h:38:53: error: field 'Message' is uninitialized when used here [-Werror,-Wuninitialized] : DiagnosticName(D.DiagnosticName), Message(Message), Fix(D.Fix), ^ llvm.git/tools/clang/include/clang/Tooling/DiagnosticsYaml.h:70:7: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] Keys->Fix[Fix.getFilePath()].add(Fix); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ 2 errors generated. Please fix. Comment Actions Fix clang compilation warnings. These didn't appear when compiled on Windows. Comment Actions Have you run the tests? I see a number of failures: $ ninja check-clang-tools ... Failing Tests (6): Clang Tools :: clang-apply-replacements/basic.cpp Clang Tools :: clang-apply-replacements/conflict.cpp Clang Tools :: clang-apply-replacements/crlf.cpp Clang Tools :: clang-apply-replacements/format.cpp Clang Tools :: clang-rename/ClassReplacements.cpp Clang Tools :: clang-tidy/clang-tidy-run-with-database.cpp Expected Passes : 488 Expected Failures : 1 Unexpected Failures: 6 Comment Actions It was tested against the clang extra unit tests, but not tests run with check-clang-tools. Comment Actions Err, looks like I forgot to post comments I entered a few days ago. Just a few nits.
Comment Actions Looks good. Fixed the issues myself and running tests before committing this. Thank you for working on this!
Comment Actions Thanks for the review!
|