From 3885b49b8ec0803d42301c7ba03f2ab8a114a2fa Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Tue, 23 Oct 2018 16:48:16 +0000 Subject: [PATCH] [clang-tidy] Add a separate section for NOLINT(NEXTLINE)? doc. llvm-svn: 345049 --- clang-tools-extra/docs/clang-tidy/index.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst index 06963ae5f5f4..20b18b4bf598 100644 --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -255,16 +255,19 @@ An overview of all the command-line options: value: 'some value' ... +Suppressing Undesired Diagnostics +================================= + :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. However, if it is known that the code is correct, the check-specific ways -to silence the diagnostics could be used, if they are available (e.g. -bugprone-use-after-move can be silenced by re-initializing the variable after -it has been moved out, misc-string-integer-assignment can be suppressed by -explicitly casting the integer to char, readability-implicit-bool-conversion -can also be suppressed by using explicit casts, etc.). If they are not -available or if changing the semantics of the code is not desired, -the ``NOLINT`` or ``NOLINTNEXTLINE`` comments can be used instead. For example: +to silence the diagnostics could be used, if they are available (e.g. +bugprone-use-after-move can be silenced by re-initializing the variable after it +has been moved out, bugprone-string-integer-assignment can be suppressed by +explicitly casting the integer to char, readability-implicit-bool-conversion can +also be suppressed by using explicit casts, etc.). If they are not available or +if changing the semantics of the code is not desired, the ``NOLINT`` or +``NOLINTNEXTLINE`` comments can be used instead. For example: .. code-block:: c++