[clang-tools-extra] r310491 - [clang-tidy] Ignore newlines in checks list
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 9 09:00:31 PDT 2017
Author: alexfh
Date: Wed Aug 9 09:00:31 2017
New Revision: 310491
URL: http://llvm.org/viewvc/llvm-project?rev=310491&view=rev
Log:
[clang-tidy] Ignore newlines in checks list
This is a follow up to https://reviews.llvm.org/D30567 where I overlooked that
LLVM YAML parser doesn't support multiline literal folding.
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=310491&r1=310490&r2=310491&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Wed Aug 9 09:00:31 2017
@@ -115,7 +115,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(' ');
+ GlobList = GlobList.trim(" \r\n");
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=310491&r1=310490&r2=310491&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp Wed Aug 9 09:00:31 2017
@@ -74,7 +74,7 @@ TEST(GlobList, WhitespacesAtBegin) {
}
TEST(GlobList, Complex) {
- GlobList Filter("*,-a.*, -b.*, a.1.* ,-a.1.A.*,-..,-...,-..+,-*$, -*qwe* ");
+ GlobList Filter("*,-a.*, -b.*, \r \n a.1.* ,-a.1.A.*,-..,-...,-..+,-*$, -*qwe* ");
EXPECT_TRUE(Filter.contains("aaa"));
EXPECT_TRUE(Filter.contains("qqq"));
More information about the cfe-commits
mailing list