[PATCH] D120187: [clang-tidy] Allow newline characters as separators for checks in Clang-Tidy configurations

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 19 16:17:00 PST 2022


njames93 added inline comments.


================
Comment at: clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp:100
+  EXPECT_TRUE(!!Options);
+  EXPECT_EQ("-*,misc-*\nllvm-*\n-clang-*,\ngoogle-*\n", *Options->Checks);
+}
----------------
SimplyDanny wrote:
> SimplyDanny wrote:
> > njames93 wrote:
> > > This seems like a shortcoming in llvms YAML parser. Isn't the fold character `>` supposed to replace newlines with spaces and strip trailing ws
> > > ```lang=c++
> > > "-*,misc-* llvm-* -clang-* google-*"
> > > ```
> > > Using the pipe `|` instead should yield the output you are currently expecting,
> > That's true. `>` should actually not work without a comma after each check.
> `YAMLParser.h` mentions that "Multi-line literal folding" is not yet implemented.
So it is, D102590 has been up addressing this very issue (Though its rather stale ATM).
In any case for now we shouldn't depend on the broken behaviour.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120187/new/

https://reviews.llvm.org/D120187



More information about the cfe-commits mailing list