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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 14:08:20 PST 2017


aaron.ballman requested changes to this revision.
aaron.ballman added a comment.
This revision now requires changes to proceed.

In https://reviews.llvm.org/D40671#947762, @xgsa wrote:

> So can this patch be submitted? Should I do something to make it happen?


There are still some outstanding concerns around the documentation wording, but once those are resolved it should be ready to commit. If you don't have commit access, I can commit on your behalf -- just let me know.



================
Comment at: docs/clang-tidy/index.rst:254-255
+While :program:`clang-tidy` diagnostics are intended to call out code that does
+not adhere to a coding standard, or is otherwise problematic in some way, there
+are times when it is more appropriate to silence the diagnostic instead of 
+changing the semantics of the code. The preferable way of doing this is using
----------------
xgsa wrote:
> aaron.ballman wrote:
> > I would reword this somewhat now. I would put a period before ", there are times" and then move that whole "there are times" clause below.
> I tried to move the "there are times"-clause below, but in this case "The preferable way of doing this is using..." becomes unclear, because it tries to explain the way of doing something without naming the purpose that is expected to achieve. So I suppose, it is necessary to place "However, there are times when it is more appropriate to silence the diagnostic instead of changing the semantics of the code" here. Am I missing something?
The current formatting of this flows strangely. It starts by saying clang-tidy calls out problems, says there are times when it is more appropriate to silence the diagnostic without changing the code, then says the preferred way is to change the code, then says you can NOLINT it if you don't want to change the code.

I'd prefer if the flow was: clang-tidy calls out problems, the preferred way is to change the code, but there are still times when changing the code is not helpful and thus you can use NOLINT.


https://reviews.llvm.org/D40671





More information about the cfe-commits mailing list