[clang-tidy docs] Fix build errors on Sphinx 1.4.5
authorAlexander Kornienko <alexfh@google.com>
Thu, 18 Aug 2016 11:06:09 +0000 (11:06 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 18 Aug 2016 11:06:09 +0000 (11:06 +0000)
llvm-svn: 279049

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
clang-tools-extra/docs/clang-tidy/checks/misc-assert-side-effect.rst
clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst
clang-tools-extra/docs/clang-tidy/checks/mpi-buffer-deref.rst
clang-tools-extra/docs/clang-tidy/checks/readability-braces-around-statements.rst
clang-tools-extra/docs/clang-tidy/checks/readability-function-size.rst
clang-tools-extra/docs/clang-tidy/index.rst

index 6e2f55d1784767bb2975cac7453e5fb0bb9e3dfc..39bbf28f1f1b3c7a44e5a0015aa35bdd4824d352 100644 (file)
@@ -8,7 +8,7 @@ This check flags all array subscript expressions on static arrays and
 are out of bounds (for ``std::array``). For out-of-bounds checking of static
 arrays, see the clang-diagnostic-array-bounds check.
 
-The check can generate fixes after the option :option:`GslHeader` has been set
+The check can generate fixes after the option `GslHeader` has been set
 to the name of the include file that contains ``gsl::at()``, e.g. `"gsl/gsl.h"`.
 
 This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see
index a4d84bbc51f4d1362e4b805e414f99e762f98ef1..3270d20daabe2a4f7d5cfb2a1b0694ec72ef135b 100644 (file)
@@ -11,8 +11,12 @@ builds.
 
 There are two options:
 
-  - :option:`AssertMacros`: A comma-separated list of the names of assert macros
-    to be checked.
-  - :option:`CheckFunctionCalls`: Whether to treat non-const member and
-    non-member functions as they produce side effects. Disabled by default
-    because it can increase the number of false positive warnings.
+.. option:: AssertMacros
+
+   A comma-separated list of the names of assert macros to be checked.
+
+.. option:: CheckFunctionCalls
+
+   Whether to treat non-const member and non-member functions as they produce
+   side effects. Disabled by default because it can increase the number of false
+   positive warnings.
index b0fe40d9e0ddd2b77ea57406030ed70d2c1c365b..604be24e2b228d43cf0212e98ca708ac27157502 100644 (file)
@@ -5,11 +5,29 @@ misc-throw-by-value-catch-by-reference
 
 "cert-err61-cpp" redirects here as an alias for this check.
 
-Finds violations of the rule "Throw by value, catch by reference" presented for example in "C++ Coding Standards" by H. Sutter and A. Alexandrescu. This check also has the option to find violations of the rule "Throw anonymous temporaries" (https://www.securecoding.cert.org/confluence/display/cplusplus/ERR09-CPP.+Throw+anonymous+temporaries). The option is named :option:`CheckThrowTemporaries` and it's on by default.
+Finds violations of the rule "Throw by value, catch by reference" presented for
+example in "C++ Coding Standards" by H. Sutter and A. Alexandrescu.
 
 Exceptions:
-  * Throwing string literals will not be flagged despite being a pointer. They are not susceptible to slicing and the usage of string literals is idomatic.
-  * Catching character pointers (``char``, ``wchar_t``, unicode character types) will not be flagged to allow catching sting literals.
-  * Moved named values will not be flagged as not throwing an anonymous temporary. In this case we can be sure that the user knows that the object can't be accessed outside catch blocks handling the error.
-  * Throwing function parameters will not be flagged as not throwing an anonymous temporary. This allows helper functions for throwing.
-  * Re-throwing caught exception variables will not be flragged as not throwing an anonymous temporary. Although this can usually be done by just writing ``throw;`` it happens often enough in real code.
+  * Throwing string literals will not be flagged despite being a pointer. They
+    are not susceptible to slicing and the usage of string literals is idomatic.
+  * Catching character pointers (``char``, ``wchar_t``, unicode character types)
+    will not be flagged to allow catching sting literals.
+  * Moved named values will not be flagged as not throwing an anonymous
+    temporary. In this case we can be sure that the user knows that the object
+    can't be accessed outside catch blocks handling the error.
+  * Throwing function parameters will not be flagged as not throwing an
+    anonymous temporary. This allows helper functions for throwing.
+  * Re-throwing caught exception variables will not be flragged as not throwing
+    an anonymous temporary. Although this can usually be done by just writing
+    ``throw;`` it happens often enough in real code.
+
+Options
+-------
+
+.. option:: CheckThrowTemporaries
+
+   Triggers detection of violations of the rule `Throw anonymous temporaries
+   <https://www.securecoding.cert.org/confluence/display/cplusplus/ERR09-CPP.+Throw+anonymous+temporaries>`_.
+   Default is `1`.
+
index 3449eb4f6a854397daffb613132da4a13d281b2c..68c19c7166927a6b388f25720f1a3a2801d1651a 100644 (file)
@@ -36,14 +36,15 @@ transforms to:
     return nullptr;
   }
 
+Options
+-------
 
-User defined macros
--------------------
+.. option:: UserNullMacros
 
-By default this check will only replace the ``NULL`` macro and will skip any
-user-defined macros that behaves like ``NULL``. The user can use the
-:option:`UserNullMacros` option to specify a comma-separated list of macro
-names that will be transformed along with ``NULL``.
+   By default this check will only replace the ``NULL`` macro and will skip any
+   user-defined macros that behaves like ``NULL``. The user can use the
+   :option:`UserNullMacros` option to specify a comma-separated list of macro
+   names that will be transformed along with ``NULL``.
 
 Example
 ^^^^^^^
index 6a3f4262f8718c59ae8dff631c712c9795a5a397..ef9f391f31fa7c4623eb1ad3007512fedc87347b 100644 (file)
@@ -10,16 +10,17 @@ types, insufficiently dereferenced buffers can be passed, like for example as
 double pointers or multidimensional arrays, without a compiler warning emitted.
 
 Examples:
-.. code:: c++
 
-  // A double pointer is passed to the MPI function.
-  char *buf;
-  MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
+.. code-block:: c++
 
-  // A multidimensional array is passed to the MPI function.
-  short buf[1][1];
-  MPI_Send(buf, 1, MPI_SHORT, 0, 0, MPI_COMM_WORLD);
+   // A double pointer is passed to the MPI function.
+   char *buf;
+   MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
 
-  // A pointer to an array is passed to the MPI function.
-  short *buf[1];
-  MPI_Send(buf, 1, MPI_SHORT, 0, 0, MPI_COMM_WORLD);
+   // A multidimensional array is passed to the MPI function.
+   short buf[1][1];
+   MPI_Send(buf, 1, MPI_SHORT, 0, 0, MPI_COMM_WORLD);
+
+   // A pointer to an array is passed to the MPI function.
+   short *buf[1];
+   MPI_Send(buf, 1, MPI_SHORT, 0, 0, MPI_COMM_WORLD);
index a60a531e40b8115985f15a5383183c2b709cfe91..86893822f2eaa185640d2380cc1317f3c2de511c 100644 (file)
@@ -6,8 +6,8 @@ readability-braces-around-statements
 `google-readability-braces-around-statements` redirects here as an alias for
 this check.
 
-Checks that bodies of ``if`` statements and loops (``for``, ``range-for``,
-``do-while``, and ``while``) are inside braces
+Checks that bodies of ``if`` statements and loops (``for``, ``do while``, and
+``while``) are inside braces.
 
 Before:
 
@@ -24,10 +24,15 @@ After:
     statement;
   }
 
-Additionally, one can define an option :option:`ShortStatementLines` defining
-the minimal number of lines that the statement should have in order to trigger
-this check.
+Options
+-------
+
+.. option:: ShortStatementLines
+
+   Defines the minimal number of lines that the statement should have in order
+   to trigger this check.
 
-The number of lines is counted from the end of condition or initial keyword
-(``do``/``else``) until the last line of the inner statement.  Default value 0
-means that braces will be added to all statements (not having them already).
+   The number of lines is counted from the end of condition or initial keyword
+   (``do``/``else``) until the last line of the inner statement.  Default value
+   `0` means that braces will be added to all statements (not having them
+   already).
index cab13986b019de3848b68537f94f9cfa2c888b7c..fbefa971987f096571d9b27fba74ee45b462c49f 100644 (file)
@@ -7,12 +7,21 @@ readability-function-size
 
 Checks for large functions based on various metrics.
 
-These options are supported:
-
-  * :option:`LineThreshold` - flag functions exceeding this number of lines. The
-    default is `-1` (ignore the number of lines).
-  * :option:`StatementThreshold` - flag functions exceeding this number of
-    statements. This may differ significantly from the number of lines for
-    macro-heavy code. The default is `800`.
-  * :option:`BranchThreshold` - flag functions exceeding this number of control
-    statements. The default is `-1` (ignore the number of branches).
+Options
+-------
+
+.. option:: LineThreshold
+
+   Flag functions exceeding this number of lines. The default is `-1` (ignore
+   the number of lines).
+
+.. option:: StatementThreshold
+
+   Flag functions exceeding this number of statements. This may differ
+   significantly from the number of lines for macro-heavy code. The default is
+   `800`.
+
+.. option:: BranchThreshold
+
+   Flag functions exceeding this number of control statements. The default is
+   `-1` (ignore the number of branches).
index 6f57bb90c4b4ee4229ff89bd2a441fef159c77e3..ae399b56829222cc0faa71728c3f9e5d2b3e0dd9 100644 (file)
@@ -48,7 +48,7 @@ The ``-list-checks`` option lists all the enabled checks. When used without
 available checks or with any other value of ``-checks=`` to see which checks are
 enabled by this value.
 
-:: _checks-groups-table:
+.. _checks-groups-table:
 
 There are currently the following groups of checks:
 
@@ -341,8 +341,8 @@ style used in the project. For code reviews we mostly use `LLVM Phabricator`_.
 .. _LLVM Phabricator: http://llvm.org/docs/Phabricator.html
 
 Next, you need to decide which module the check belongs to. Modules
-are located in subdirectories of
-``clang-tidy/ <http://reviews.llvm.org/diffusion/L/browse/clang-tools-extra/trunk/clang-tidy/>``_
+are located in subdirectories of `clang-tidy/
+<http://reviews.llvm.org/diffusion/L/browse/clang-tools-extra/trunk/clang-tidy/>`_
 and contain checks targeting a certain aspect of code quality (performance,
 readability, etc.), certain coding style or standard (Google, LLVM, CERT, etc.)
 or a widely used API (e.g. MPI). Their names are same as user-facing check