Skip to content

Commit 52639d6

Browse files
authored
[clang-tidy][NFC][doc] improve "options" sections of bugprone- and modernize- checks (#133525)
Improved "options" sections of `bugprone-` and `modernize-` checks: 1. Added `Options` keyword to be a delimiter between "body" and "options" parts of docs 2. Added default values where was absent. 3. Improved readability of some default values by converting `1` to `true`.
1 parent 1f7f268 commit 52639d6

15 files changed

+38
-7
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/assert-side-effect.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Options
1515
.. option:: AssertMacros
1616

1717
A comma-separated list of the names of assert macros to be checked.
18+
Default is `assert,NSAssert,NSCAssert`.
1819

1920
.. option:: CheckFunctionCalls
2021

clang-tools-extra/docs/clang-tidy/checks/bugprone/capturing-this-in-member-variable.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Possible fixes:
3232
object types.
3333
- passing ``this`` pointer as parameter
3434

35+
Options
36+
-------
37+
3538
.. option:: FunctionWrapperTypes
3639

3740
A semicolon-separated list of names of types. Used to specify function

clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,16 @@ so both arguments will have the same type.
104104
return false;
105105
}
106106

107+
Options
108+
-------
109+
107110
.. option:: CharTypdefsToIgnore
108111

109112
A semicolon-separated list of typedef names. In this list, we can list
110113
typedefs for ``char`` or ``signed char``, which will be ignored by the
111114
check. This is useful when a typedef introduces an integer alias like
112115
``sal_Int8`` or ``int8_t``. In this case, human misinterpretation is not
113-
an issue.
116+
an issue. Default is an empty string.
114117

115118
.. option:: DiagnoseSignedUnsignedCharComparisons
116119

clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-enum-usage.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Examples:
7171
7272
Options
7373
-------
74+
7475
.. option:: StrictMode
7576

7677
Default value: 0.

clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-stringview-data-usage.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ lead to a compilation error due to the explicit nature of the ``std::string``
4343
constructor. Consequently, developers might opt for ``sv.data()`` to resolve the
4444
compilation error, albeit introducing potential hazards as discussed.
4545

46+
Options
47+
-------
48+
4649
.. option:: StringViewTypes
4750

4851
Option allows users to specify custom string view-like types for analysis. It

clang-tools-extra/docs/clang-tidy/checks/bugprone/too-small-loop-variable.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ It's recommended to enable the compiler warning
3232
`-Wtautological-constant-out-of-range-compare` as well, since check does not
3333
inspect compile-time constant loop boundaries to avoid overlaps with the warning.
3434

35+
Options
36+
-------
37+
3538
.. option:: MagnitudeBitsUpperLimit
3639

3740
Upper limit for the magnitude bits of the loop variable. If it's set the check

clang-tools-extra/docs/clang-tidy/checks/bugprone/unhandled-self-assignment.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ temporary object into ``this`` (needs a move assignment operator):
118118
}
119119
};
120120
121+
Options
122+
-------
123+
121124
.. option:: WarnOnlyIfThisHasSuspiciousField
122125

123126
When `true`, the check will warn only if the container class of the copy

clang-tools-extra/docs/clang-tidy/checks/bugprone/unintended-char-ostream-output.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ Or cast to char to explicitly indicate that output should be a character.
3939

4040
std::cout << static_cast<char>(v);
4141

42+
Options
43+
-------
44+
4245
.. option:: CastTypeName
4346

4447
When `CastTypeName` is specified, the fix-it will use `CastTypeName` as the

clang-tools-extra/docs/clang-tidy/checks/modernize/avoid-bind.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ Options
5050
of every placeholder parameter list. Without this, it is possible for a fix-it
5151
to perform an incorrect transformation in the case where the result of the ``bind``
5252
is used in the context of a type erased functor such as ``std::function`` which
53-
allows mismatched arguments. For example:
53+
allows mismatched arguments. Default is is `false`.
5454

55+
For example:
5556

5657
.. code-block:: c++
5758

clang-tools-extra/docs/clang-tidy/checks/modernize/avoid-c-arrays.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Similarly, the ``main()`` function is ignored. Its second and third parameters
6262
can be either ``char* argv[]`` or ``char** argv``, but cannot be
6363
``std::array<>``.
6464

65+
Options
66+
-------
67+
6568
.. option:: AllowStringArrays
6669

6770
When set to `true` (default is `false`), variables of character array type

0 commit comments

Comments
 (0)