diff --git a/clang-tools-extra/clang-tidy/GlobList.cpp b/clang-tools-extra/clang-tidy/GlobList.cpp --- a/clang-tools-extra/clang-tidy/GlobList.cpp +++ b/clang-tools-extra/clang-tidy/GlobList.cpp @@ -15,7 +15,7 @@ // Returns true if GlobList starts with the negative indicator ('-'), removes it // from the GlobList. static bool consumeNegativeIndicator(StringRef &GlobList) { - GlobList = GlobList.trim(" \r\n"); + GlobList = GlobList.trim(); if (GlobList.startswith("-")) { GlobList = GlobList.substr(1); return true; @@ -27,7 +27,7 @@ // removes it and the trailing comma from the GlobList. static llvm::Regex consumeGlob(StringRef &GlobList) { StringRef UntrimmedGlob = GlobList.substr(0, GlobList.find(',')); - StringRef Glob = UntrimmedGlob.trim(' '); + StringRef Glob = UntrimmedGlob.trim(); GlobList = GlobList.substr(UntrimmedGlob.size() + 1); SmallString<128> RegexText("^"); StringRef MetaChars("()^$|*+?.[]\\{}"); diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-file/config-file-spaces b/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-file/config-file-spaces new file mode 100644 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-file/config-file-spaces @@ -0,0 +1,9 @@ +Checks: " + -* + , + hicpp-uppercase-literal-suffix + ,hicpp-use-auto + + + , hicpp-use-emplace +" diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/config-file.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/config-file.cpp --- a/clang-tools-extra/test/clang-tidy/infrastructure/config-file.cpp +++ b/clang-tools-extra/test/clang-tidy/infrastructure/config-file.cpp @@ -1,2 +1,8 @@ // RUN: clang-tidy -config-file=%S/Inputs/config-file/config-file -dump-config -- | FileCheck %s -check-prefix=CHECK-BASE // CHECK-BASE: Checks: {{.*}}hicpp-uppercase-literal-suffix +// RUN: clang-tidy -config-file=%S/Inputs/config-file/config-file-spaces --list-checks -- | FileCheck %s -check-prefix=CHECK-SPACES +// CHECK-SPACES: Enabled checks: +// CHECK-SPACES-NEXT: hicpp-uppercase-literal-suffix +// CHECK-SPACES-NEXT: hicpp-use-auto +// CHECK-SPACES-NEXT: hicpp-use-emplace +// CHECK-SPACES-EMPTY: