[clang-tidy] Ignore spaces between globs in the Checks option.

llvm-svn: 295303
This commit is contained in:
Alexander Kornienko 2017-02-16 10:23:18 +00:00
parent 7f82c87022
commit 762adef1a9
2 changed files with 2 additions and 1 deletions

View File

@ -119,6 +119,7 @@ ClangTidyError::ClangTidyError(StringRef CheckName,
// 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;

View File

@ -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"));