Author: alexfh
Date: Thu Feb 16 04:23:18 2017
New Revision: 295303

URL: http://llvm.org/viewvc/llvm-project?rev=295303&view=rev
Log:
[clang-tidy] Ignore spaces between globs in the Checks option.

Modified:
    clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
    
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp

Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=295303&r1=295302&r2=295303&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp 
(original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Thu Feb 
16 04:23:18 2017
@@ -119,6 +119,7 @@ ClangTidyError::ClangTidyError(StringRef
 // Returns true if GlobList starts with the negative indicator ('-'), removes 
it
 // from the GlobList.
 static bool ConsumeNegativeIndicator(StringRef &GlobList) {
+  GlobList = GlobList.trim(' ');
   if (GlobList.startswith("-")) {
     GlobList = GlobList.substr(1);
     return true;

Modified: 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp?rev=295303&r1=295302&r2=295303&view=diff
==============================================================================
--- 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
 (original)
+++ 
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
 Thu Feb 16 04:23:18 2017
@@ -67,7 +67,7 @@ TEST(GlobList, Simple) {
 }
 
 TEST(GlobList, Complex) {
-  GlobList Filter("*,-a.*,-b.*,a.1.*,-a.1.A.*,-..,-...,-..+,-*$,-*qwe*");
+  GlobList Filter("*,-a.*, -b.*,   a.1.* ,-a.1.A.*,-..,-...,-..+,-*$, -*qwe* 
");
 
   EXPECT_TRUE(Filter.contains("aaa"));
   EXPECT_TRUE(Filter.contains("qqq"));


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to