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

Hassan ElDesouky via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 25 11:23:09 PST 2022


HassanElDesouky 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);
+}
----------------
njames93 wrote:
> 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.
Thanks for motivating me to get D102590 to the finish line. I think it's ready now.


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