[clang-tools-extra] r267697 - clang-tidy -list-checks should exit with non-zero code when no checks are enabled.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 04:45:14 PDT 2016


Author: alexfh
Date: Wed Apr 27 06:45:14 2016
New Revision: 267697

URL: http://llvm.org/viewvc/llvm-project?rev=267697&view=rev
Log:
clang-tidy -list-checks should exit with non-zero code when no checks are enabled.

Modified:
    clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp

Modified: clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp?rev=267697&r1=267696&r2=267697&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/tool/ClangTidyMain.cpp Wed Apr 27 06:45:14 2016
@@ -333,6 +333,10 @@ static int clangTidyMain(int argc, const
   }
 
   if (ListChecks) {
+    if (EnabledChecks.empty()) {
+      llvm::errs() << "No checks enabled.\n";
+      return 1;
+    }
     llvm::outs() << "Enabled checks:";
     for (auto CheckName : EnabledChecks)
       llvm::outs() << "\n    " << CheckName;




More information about the cfe-commits mailing list