[cfe-dev] [clang-tidy][RFC] Proposal: enable globbing in NOLINT expressions

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 5 07:12:10 PDT 2021


On Tue, Oct 5, 2021 at 9:42 AM Carlos Galvez via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hi,
>
> Currently it's annoying or sometimes impossible (due to line length limit) to accurately inline-suppress clang-tidy warnings. For example:
>
> // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes,misc-non-private-member-variables-in-classes)
>
> This is not an uncommon case of someone enabling both a "coding guideline" module and "best practices" module.
>
> The solution turns into a very bad practice, which is disabling all warnings, potentially hiding additional bugs:
>
> // NOLINT
>
> Proposal: support globbing for NOLINT expressions, with the same format/semantics as when enabling/disabling checks:
>
> // NOLINT(*-non-private-member-variables-in-classes)
>
> What do you think?

I think it's a good idea -- we already support some of the globbing
functionality today (https://godbolt.org/z/jTsahYnbM), so this
proposes to extend it in a useful way.

~Aaron

>
> /Carlos
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list