[PATCH] D40671: [clang-tidy] Support specific checks for NOLINT directive

Anton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 23:56:54 PST 2017


xgsa added a comment.

In https://reviews.llvm.org/D40671#954661, @alexfh wrote:

> In https://reviews.llvm.org/D40671#953888, @aaron.ballman wrote:
>
> > FWIW, I think we should do something about unknown check names in NOLINT comments, but that can be done as a follow-up patch. If we're ignoring the comment, we might want to diagnose that fact so users have an idea what's going on.
>
>
> IIUC, cpplint can output a diagnostic about unknown categories inside NOLINT and about NOLINT directives that happen on lines where no warning is emitted. Both would be useful in clang-tidy, IMO.


I agree with your statements and I think there should be the following diagnostics about NOLINT usage:

- as you described, using of NOLINT with unknown check names;
- using of NOLINT for the line, on which there is no diagnostics (at all with NOLINT and for the swpecified diagnostics); this should help to detect dangling NOLINT comments, that have no meaning anymore.

Moreover, there should be a way to turn on/off these diagnostics, so possibily they should be a separate checks. What do you think? Is there a way for a check to collect the emitted diagnostics?


https://reviews.llvm.org/D40671





More information about the cfe-commits mailing list