[PATCH] D111208: [clang-tidy] Support globbing in NOLINT* expressions

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 9 01:54:30 PDT 2021


carlosgalvezp marked an inline comment as done.
carlosgalvezp added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:349
+      // Allow specifying a few checks with a glob expression.
+      GlobList Globs(ChecksStr);
+      if (!Globs.contains(CheckName))
----------------
salman-javed-nz wrote:
> What happens when `CheckStr` is empty?
> How has Clang-Tidy treated `// NOLINT()` in the past? Does this patch change the behaviour? What //should // be the "right" behaviour?
Very good question! Currently on master `// NOLINT()` will *not* suppress warnings. However `// NOLINT(` will. My patch shouldn't change existing behavior - an empty list of globs will return false when calling `contains`.

I'll add a unit test to cover this case!


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

https://reviews.llvm.org/D111208



More information about the cfe-commits mailing list