[PATCH] Update clang-tidy documentation.

Alexander Kornienko alexfh at google.com
Thu May 15 14:17:02 PDT 2014


Hi klimek,

Updated the help message, updated description of -checks=, removed
mentions of -disable-checks.

http://reviews.llvm.org/D3793

Files:
  docs/clang-tidy.rst

Index: docs/clang-tidy.rst
===================================================================
--- docs/clang-tidy.rst
+++ docs/clang-tidy.rst
@@ -23,12 +23,21 @@
 
 :program:`clang-tidy` has its own checks and can also run Clang static analyzer
 checks. Each check has a name and the checks to run can be chosen using the
-``-checks=`` and ``-disable-checks=`` options. :program:`clang-tidy` selects the
-checks with names matching the regular expression specified by the ``-checks=``
-option and not matching the one specified by the ``-disable-checks=`` option.
+``-checks=`` option, which specifies a comma-separated list of positive and
+negative (prefixed with ``-``) globs. Positive globs add subsets of checks,
+negative globs remove them. For example,
 
-The ``-list-checks`` option lists all the enabled checks. It can be used with or
-without ``-checks=`` and/or ``-disable-checks=``.
+.. code-block:: bash
+
+  $ clang-tidy test.cpp -checks='-*,clang-analyzer-*,-clang-analyzer-alpha*'
+
+will disable all default checks (``-*``) and enable all ``clang-analyzer-*``
+checks except for ``clang-analyzer-alpha*`` ones.
+
+The ``-list-checks`` option lists all the enabled checks. When used without
+``-checks=``, it shows checks enabled by default. Use ``-checks='*'`` to see all
+available checks or with any other value of ``-checks=`` to see which checks are
+enabled by this value.
 
 There are currently three groups of checks:
 
@@ -38,6 +47,9 @@
 * Checks related to the Google coding conventions have names starting with
   ``google-``.
 
+* Checks with names starting with ``misc-`` don't relate to any particular
+  coding style.
+
 * Clang static analyzer checks are named starting with ``clang-analyzer-``.
 
 
@@ -63,11 +75,16 @@
 
   clang-tidy options:
 
-    -checks=<string>         - Regular expression matching the names of
-                               the checks to be run.
-    -disable-checks=<string> - Regular expression matching the names of
-                               the checks to disable.
+    -analyze-temporary-dtors - Enable temporary destructor-aware analysis
+                               in clang-analyzer- checks.
+    -checks=<string>         - Comma-separated list of positive and
+                               negative globs matching the names of the
+                               checks to be run.
     -fix                     - Fix detected errors if possible.
+    -header-filter=<string>  - Regular expression matching the names of
+                               the headers to output diagnostics from.
+                               Diagnostics from the main file of each
+                               translation unit are always displayed.
     -list-checks             - List all enabled checks and exit.
     -p=<string>              - Build path
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3793.9455.patch
Type: text/x-patch
Size: 2824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140515/0cdf0db6/attachment.bin>


More information about the cfe-commits mailing list