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

Carlos Galvez via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 5 08:47:07 PDT 2021


Awesome, thanks! I'll give it a try when I find some time :)

/Carlos

On Tue, Oct 5, 2021 at 4:12 PM Aaron Ballman <aaron at aaronballman.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211005/e766cfaf/attachment-0001.html>


More information about the cfe-dev mailing list