diff options
| author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-04-02 01:07:18 +0000 |
|---|---|---|
| committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-04-02 01:07:18 +0000 |
| commit | 71d175b42900ef75396f2f80638a0fd3ce8d5cd5 (patch) | |
| tree | 9e49c5fd20d36f6f626dc533cb5d7d1c3ad4afe4 | |
| parent | fa6e414eef1e0c915f640bf2812978a1f319a203 (diff) | |
| download | bcm5719-llvm-71d175b42900ef75396f2f80638a0fd3ce8d5cd5.tar.gz bcm5719-llvm-71d175b42900ef75396f2f80638a0fd3ce8d5cd5.zip | |
[Clang-tidy] Improve checks documentation consistency.
Differential revision: http://reviews.llvm.org/D18717
llvm-svn: 265205
34 files changed, 85 insertions, 124 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-err52-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-err52-cpp.rst index d8be5a8dd9a..a29dc7bcd32 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-err52-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-err52-cpp.rst @@ -3,7 +3,7 @@ cert-err52-cpp ============== -This check flags all call expressions involving setjmp() and longjmp(). +This check flags all call expressions involving ``setjmp()`` and ``longjmp()``. This check corresponds to the CERT C++ Coding Standard rule `ERR52-CPP. Do not use setjmp() or longjmp() diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-err58-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-err58-cpp.rst index 9fec67f0ec4..139d227b0f0 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-err58-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-err58-cpp.rst @@ -3,8 +3,8 @@ cert-err58-cpp ============== -This check flags all static or thread_local variable declarations where the -constructor for the object may throw an exception. +This check flags all ``static`` or ``thread_local`` variable declarations where +the constructor for the object may throw an exception. This check corresponds to the CERT C++ Coding Standard rule `ERR58-CPP. Constructors of objects with static or thread storage duration must not throw exceptions diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst index cfccb77a53b..c37b63980be 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-flp30-c.rst @@ -3,8 +3,8 @@ cert-flp30-c ============ -This check flags ``for`` loops where the induction expression has a floating- -point type. +This check flags ``for`` loops where the induction expression has a +floating-point type. This check corresponds to the CERT C Coding Standard rule `FLP30-C. Do not use floating-point variables as loop counters diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst index dd20a52ac19..6e2f55d1784 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst @@ -8,9 +8,8 @@ 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 -``cppcoreguidelines-pro-bounds-constant-array-index.GslHeader`` has been set to -the name of the include file that contains ``gsl::at()``, e.g. ``"gsl/gsl.h"``. +The check can generate fixes after the option :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 https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-arrayindex. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-build-explicit-make-pair.rst b/clang-tools-extra/docs/clang-tidy/checks/google-build-explicit-make-pair.rst index 8069932e0f1..e3e9eeb0e97 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-build-explicit-make-pair.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-build-explicit-make-pair.rst @@ -8,4 +8,4 @@ Check that ``make_pair``'s template arguments are deduced. G++ 4.6 in C++11 mode fails badly if ``make_pair``'s template arguments are specified explicitly, and such use isn't intended in any case. -Corresponding cpplint.py check name: 'build/explicit_make_pair'. +Corresponding cpplint.py check name: `build/explicit_make_pair`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-build-namespaces.rst b/clang-tools-extra/docs/clang-tidy/checks/google-build-namespaces.rst index a1477132960..4249c280233 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-build-namespaces.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-build-namespaces.rst @@ -3,10 +3,10 @@ google-build-namespaces ======================= -"cert-dcl59-cpp" redirects here as an alias for this check. +`cert-dcl59-cpp` redirects here as an alias for this check. Finds anonymous namespaces in headers. https://google.github.io/styleguide/cppguide.html#Namespaces -Corresponding cpplint.py check name: 'build/namespaces'. +Corresponding cpplint.py check name: `build/namespaces`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst b/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst index 23b9b68a2df..baa81600269 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst @@ -3,8 +3,7 @@ google-build-using-namespace ============================ - -Finds using namespace directives. +Finds ``using namespace`` directives. https://google.github.io/styleguide/cppguide.html#Namespaces @@ -18,4 +17,4 @@ The check implements the following rule of the Google C++ Style Guide: // Forbidden -- This pollutes the namespace. using namespace foo; -Corresponding cpplint.py check name: ``build/namespaces``. +Corresponding cpplint.py check name: `build/namespaces`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-global-names-in-headers.rst b/clang-tools-extra/docs/clang-tidy/checks/google-global-names-in-headers.rst index 8cdd2f5b718..33a751235ab 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-global-names-in-headers.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-global-names-in-headers.rst @@ -3,6 +3,5 @@ google-global-names-in-headers ============================== - Flag global namespace pollution in header files. -Right now it only triggers on using declarations and directives. +Right now it only triggers on ``using`` declarations and directives. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-readability-braces-around-statements.rst b/clang-tools-extra/docs/clang-tidy/checks/google-readability-braces-around-statements.rst index 22dfd07d95f..e5c8eb64c3a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-readability-braces-around-statements.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-readability-braces-around-statements.rst @@ -1,31 +1,10 @@ .. title:: clang-tidy - google-readability-braces-around-statements +.. meta:: + :http-equiv=refresh: 5;URL=readability-braces-around-statements.html google-readability-braces-around-statements =========================================== - -Checks that bodies of ``if`` statements and loops (``for``, ``range-for``, -``do-while``, and ``while``) are inside braces - -Before: - -.. code:: c++ - - if (condition) - statement; - -After: - -.. code:: c++ - - if (condition) { - statement; - } - -Additionally, one can define an option ``ShortStatementLines`` defining 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 google-readability-braces-around-statements check is an alias, please see +`readability-braces-around-statements <readability-braces-around-statements.html>`_ +for more information. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-readability-casting.rst b/clang-tools-extra/docs/clang-tidy/checks/google-readability-casting.rst index af4d909edb0..4c9d1bc4f99 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-readability-casting.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-readability-casting.rst @@ -3,13 +3,12 @@ google-readability-casting ========================== - Finds usages of C-style casts. https://google.github.io/styleguide/cppguide.html#Casting -Corresponding cpplint.py check name: 'readability/casting'. +Corresponding cpplint.py check name: `readability/casting`. -This check is similar to ``-Wold-style-cast``, but it suggests automated fixes +This check is similar to `-Wold-style-cast`, but it suggests automated fixes in some cases. The reported locations should not be different from the -ones generated by ``-Wold-style-cast``. +ones generated by `-Wold-style-cast`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-readability-function-size.rst b/clang-tools-extra/docs/clang-tidy/checks/google-readability-function-size.rst index e542e356ce7..b4546284ced 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-readability-function-size.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-readability-function-size.rst @@ -1,17 +1,10 @@ .. title:: clang-tidy - google-readability-function-size +.. meta:: + :http-equiv=refresh: 5;URL=readability-function-size.html google-readability-function-size ================================ - -Checks for large functions based on various metrics. - -These options are supported: - - * ``LineThreshold`` - flag functions exceeding this number of lines. The - default is ``-1`` (ignore the number of lines). - * ``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``. - * ``BranchThreshold`` - flag functions exceeding this number of control - statements. The default is ``-1`` (ignore the number of branches). +The google-readability-function-size check is an alias, please see +`readability-function-size <readability-function-size.html>`_ for more +information. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-readability-todo.rst b/clang-tools-extra/docs/clang-tidy/checks/google-readability-todo.rst index 16c9b165d4d..86c04a8c039 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-readability-todo.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-readability-todo.rst @@ -3,7 +3,6 @@ google-readability-todo ======================= - Finds TODO comments without a username or bug number. -Corresponding cpplint.py check: 'readability/todo' +Corresponding cpplint.py check: `readability/todo` diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-int.rst b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-int.rst index 181d2dec000..eace60b9280 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-int.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-int.rst @@ -3,11 +3,10 @@ google-runtime-int ================== - Finds uses of ``short``, ``long`` and ``long long`` and suggest replacing them with ``u?intXX(_t)?``. The corresponding style guide rule: https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Integer_Types. -Correspondig cpplint.py check: 'runtime/int'. +Correspondig cpplint.py check: `runtime/int`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-member-string-references.rst b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-member-string-references.rst index 26e889bb2c7..8e468e3b79f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-member-string-references.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-member-string-references.rst @@ -3,7 +3,6 @@ google-runtime-member-string-references ======================================= - Finds members of type ``const string&``. const string reference members are generally considered unsafe as they can @@ -24,4 +23,4 @@ reference. This check emit warnings for both ``std::string`` and ``::string`` const reference members. -Corresponding cpplint.py check name: 'runtime/member_string_reference'. +Corresponding cpplint.py check name: `runtime/member_string_reference`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-memset.rst b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-memset.rst index 63a679c1fb5..3832b6e4485 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-memset.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-memset.rst @@ -3,10 +3,8 @@ google-runtime-memset ===================== +Finds calls to ``memset`` with a literal zero in the length argument. -Finds calls to memset with a literal zero in the length argument. +This is most likely unintended and the length and value arguments are swapped. -This is most likely unintended and the length and value arguments are -swapped. - -Corresponding cpplint.py check name: 'runtime/memset'. +Corresponding cpplint.py check name: `runtime/memset`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-operator.rst b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-operator.rst index 5d4138e7bf6..67f29930050 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-runtime-operator.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-runtime-operator.rst @@ -3,9 +3,8 @@ google-runtime-operator ======================= - Finds overloads of unary ``operator &``. https://google.github.io/styleguide/cppguide.html#Operator_Overloading -Corresponding cpplint.py check name: 'runtime/operator'. +Corresponding cpplint.py check name: `runtime/operator`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index c80ea50f072..65882d01b4f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -31,9 +31,9 @@ Clang-Tidy Checks google-build-using-namespace google-explicit-constructor google-global-names-in-headers - google-readability-braces-around-statements + google-readability-braces-around-statements (redirects to readability-braces-around-statements) <readability-braces-around-statements> google-readability-casting - google-readability-function-size + google-readability-function-size (redirects to readability-function-size) <readability-function-size> google-readability-namespace-comments google-readability-redundant-smartptr-get google-readability-todo diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-assert-side-effect.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-assert-side-effect.rst index 798b62044ac..a4d84bbc51f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-assert-side-effect.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-assert-side-effect.rst @@ -3,7 +3,6 @@ misc-assert-side-effect ======================= - Finds ``assert()`` with side effect. The condition of ``assert()`` is evaluated only in debug builds so a @@ -12,8 +11,8 @@ builds. There are two options: - - ``AssertMacros``: A comma-separated list of the names of assert macros to - be checked. - - ``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. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-bool-pointer-implicit-conversion.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-bool-pointer-implicit-conversion.rst index 85509c233b8..aa1bc202f72 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-bool-pointer-implicit-conversion.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-bool-pointer-implicit-conversion.rst @@ -3,9 +3,8 @@ misc-bool-pointer-implicit-conversion ===================================== - -Checks for conditions based on implicit conversion from a bool pointer to -bool. +Checks for conditions based on implicit conversion from a ``bool`` pointer to +``bool``. Example: diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst index 38b523aea01..727436d8464 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-new-delete-overloads.rst @@ -3,13 +3,14 @@ misc-new-delete-overloads ========================= -"cert-dcl54-cpp" redirects here as an alias for this check. +`cert-dcl54-cpp` redirects here as an alias for this check. -The check flags overloaded operator new() and operator delete() functions that -do not have a corresponding free store function defined within the same scope. +The check flags overloaded operator ``new()`` and operator ``delete()`` +functions that do not have a corresponding free store function defined within +the same scope. For instance, the check will flag a class implementation of a non-placement -operator new() when the class does not also define a non-placement operator -delete() function as well. +operator ``new()`` when the class does not also define a non-placement operator +``delete()`` function as well. The check does not flag implicitly-defined operators, deleted or private operators, or placement operators. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-non-copyable-objects.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-non-copyable-objects.rst index dd0d14b78aa..d1f7bba39b3 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-non-copyable-objects.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-non-copyable-objects.rst @@ -3,11 +3,11 @@ misc-non-copyable-objects ========================= -"cert-fio38-c" redirects here as an alias for this check. +`cert-fio38-c` redirects here as an alias for this check. The check flags dereferences and non-pointer declarations of objects that are not meant to be passed by value, such as C FILE objects or POSIX -pthread_mutex_t objects. +``pthread_mutex_t`` objects. This check corresponds to CERT C++ Coding Standard rule `FIO38-C. Do not copy a FILE object <https://www.securecoding.cert.org/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object>`_. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst index 5465797525b..cf0cc2d130d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst @@ -3,7 +3,7 @@ misc-static-assert ================== -"cert-dcl03-c" redirects here as an alias for this check. +`cert-dcl03-c` redirects here as an alias for this check. Replaces ``assert()`` with ``static_assert()`` if the condition is evaluatable at compile time. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-semicolon.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-semicolon.rst index c8bd0e34f92..8a5711ff662 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-semicolon.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-semicolon.rst @@ -4,10 +4,10 @@ misc-suspicious-semicolon ========================= Finds most instances of stray semicolons that unexpectedly alter the meaning of -the code. More specifically, it looks for `if`, `while`, `for` and `for-range` -statements whose body is a single semicolon, and then analyzes the context of -the code (e.g. indentation) in an attempt to determine whether that is -intentional. +the code. More specifically, it looks for ``if``, ``while``, ``for`` and +``for-range`` statements whose body is a single semicolon, and then analyzes the +context of the code (e.g. indentation) in an attempt to determine whether that +is intentional. .. code-block:: c++ @@ -16,8 +16,8 @@ intentional. x++; } -Here the body of the `if` statement consists of only the semicolon at the end of -the first line, and `x` will be incremented regardless of the condition. +Here the body of the ``if`` statement consists of only the semicolon at the end +of the first line, and `x` will be incremented regardless of the condition. .. code-block:: c++ @@ -26,7 +26,7 @@ the first line, and `x` will be incremented regardless of the condition. processLine(line); As a result of this code, `processLine()` will only be called once, when the -`while` loop with the empty body exits with `line == NULL`. The indentation of +``while`` loop with the empty body exits with `line == NULL`. The indentation of the code indicates the intention of the programmer. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst index 3b26f307037..b0fe40d9e0d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst @@ -5,7 +5,7 @@ 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 ``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. 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. 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. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst index 224c997dfb6..4e037351b27 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-unused-parameters.rst @@ -3,6 +3,5 @@ misc-unused-parameters ====================== - -Finds unused parameters and fixes them, so that ``-Wunused-parameter`` can be +Finds unused parameters and fixes them, so that `-Wunused-parameter` can be turned on. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst index 9ef9772fda1..bad574f6e90 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst @@ -23,7 +23,7 @@ reference to a declared expression (a variable, function, enum, etc.), and some part of it appears elsewhere in the loop, we lower our confidence in the transformation due to the increased risk of changing semantics. Transformations for these loops are marked as `risky`, and thus will only -be converted if the minimum required confidence level is set to ``risky``. +be converted if the minimum required confidence level is set to `risky`. .. code-block:: c++ @@ -46,7 +46,7 @@ reasonable (Default) If a loop calls ``.end()`` or ``.size()`` after each iteration, the transformation for that loop is marked as `reasonable`, and thus will -be converted if the required confidence level is set to ``reasonable`` +be converted if the required confidence level is set to `reasonable` (default) or lower. .. code-block:: c++ @@ -60,7 +60,7 @@ safe Any other loops that do not match the above criteria to be marked as `risky` or `reasonable` are marked `safe`, and thus will be converted -if the required confidence level is set to ``safe`` or lower. +if the required confidence level is set to `safe` or lower. .. code-block:: c++ @@ -95,7 +95,7 @@ Original: for (int i = 0; i < v.size(); ++i) cout << v[i]; -After applying the check with minimum confidence level set to ``reasonable`` (default): +After applying the check with minimum confidence level set to `reasonable` (default): .. code-block:: c++ @@ -231,11 +231,11 @@ circumvent the analysis by accessing and modifying the container through a pointer or reference. If the container were directly used instead of using the pointer or reference -the following transformation would have only been applied at the ``risky`` +the following transformation would have only been applied at the `risky` level since calling a member function of the container is considered `risky`. The check cannot identify expressions associated with the container that are different than the one used in the loop header, therefore the transformation -below ends up being performed at the ``safe`` level. +below ends up being performed at the `safe` level. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst index 6a3c9000404..d045c3a4afa 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst @@ -35,7 +35,7 @@ Pass-by-value in constructors Replaces the uses of const-references constructor parameters that are copied into class fields. The parameter is then moved with `std::move()`. -Since `std::move()` is a library function declared in `<utility>` it may be +Since ``std::move()`` is a library function declared in `<utility>` it may be necessary to add this include. The check will add the include directive when necessary. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst index 3329e9773f8..f6207840dc7 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst @@ -108,7 +108,7 @@ conditions are satisfied: * The initializer for the variable being declared is not a braced initializer list. Otherwise, use of ``auto`` would cause the type of the variable to be - deduced as``std::initializer_list``. + deduced as ``std::initializer_list``. New expressions --------------- diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst index f0219e3abea..3449eb4f6a8 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst @@ -42,7 +42,7 @@ User defined macros 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 +:option:`UserNullMacros` option to specify a comma-separated list of macro names that will be transformed along with ``NULL``. Example @@ -64,4 +64,4 @@ transforms to: int *p = nullptr; } -if the ``UserNullMacros`` option is set to ``MY_NULL``. +if the :option:`UserNullMacros` option is set to ``MY_NULL``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst b/clang-tools-extra/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst index 4a3c63d860a..58222039db4 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst @@ -16,5 +16,5 @@ Example: // The iterator type is in fact pair<const int, vector<string>>, which means // that the compiler added a cast, resulting in a copy of the vectors. -The easiest solution is usually to use "const auto&" instead of writing the type +The easiest solution is usually to use ``const auto&`` instead of writing the type manually. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-braces-around-statements.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-braces-around-statements.rst index a1041f6ea9c..a60a531e40b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-braces-around-statements.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-braces-around-statements.rst @@ -3,6 +3,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 @@ -22,8 +24,8 @@ After: statement; } -Additionally, one can define an option ``ShortStatementLines`` defining the -minimal number of lines that the statement should have in order to trigger +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. The number of lines is counted from the end of condition or initial keyword diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-function-size.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-function-size.rst index 44958d71acb..cab13986b01 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-function-size.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-function-size.rst @@ -3,15 +3,16 @@ readability-function-size ========================= +`google-readability-function-size` redirects here as an alias for this check. Checks for large functions based on various metrics. These options are supported: - * ``LineThreshold`` - flag functions exceeding this number of lines. The - default is ``-1`` (ignore the number of lines). - * ``StatementThreshold`` - flag functions exceeding this number of + * :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``. - * ``BranchThreshold`` - flag functions exceeding this number of control - statements. The default is ``-1`` (ignore the number of branches). + 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). diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst index c03011adb75..30408c12b5b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst @@ -3,12 +3,11 @@ readability-identifier-naming ============================= - Checks for identifiers naming style mismatch. This check will try to enforce coding guidelines on the identifiers naming. -It supports ``lower_case``, ``UPPER_CASE``, ``camelBack`` and ``CamelCase`` casing -and tries to convert from one to another if a mismatch is detected. +It supports `lower_case`, `UPPER_CASE`, `camelBack` and `CamelCase` casing and +tries to convert from one to another if a mismatch is detected. It also supports a fixed prefix and suffix that will be prepended or appended to the identifiers, regardless of the casing. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-named-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-named-parameter.rst index 1e4f6f0eebb..8d28c0aa021 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-named-parameter.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-named-parameter.rst @@ -3,7 +3,6 @@ readability-named-parameter =========================== - Find functions with unnamed arguments. The check implements the following rule originating in the Google C++ Style @@ -14,4 +13,4 @@ https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Defi All parameters should be named, with identical names in the declaration and implementation. -Corresponding cpplint.py check name: 'readability/function'. +Corresponding cpplint.py check name: `readability/function`. |

