Skip to content

Commit 547d054

Browse files
[clang-tidy][NFC][doc] improve "options" sections of misc-, cppcore- and other checks (#133694)
Improved "options" sections of various checks: 1. Added Options keyword to be a delimiter between "body" and "options" parts of docs 2. Added default values where were absent. 3. Changed double-tick to single-tick in default values. --------- Co-authored-by: EugeneZelenko <[email protected]>
1 parent babbc6f commit 547d054

15 files changed

+33
-18
lines changed

clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ Options
4141
.. option:: RetryMacros
4242

4343
A comma-separated list of the names of retry macros to be checked.
44+
Default is `TEMP_FAILURE_RETRY`.

clang-tools-extra/docs/clang-tidy/checks/cert/msc51-cpp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ Options
3737
.. option:: DisallowedSeedTypes
3838

3939
A comma-separated list of the type names which are disallowed.
40-
Default values are ``time_t``, ``std::time_t``.
40+
Default value is `time_t,std::time_t`.

clang-tools-extra/docs/clang-tidy/checks/concurrency/mt-unsafe.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Examples:
3232

3333
sleep(1); // implementation may use SIGALRM
3434

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

3740
Specifies which functions in libc should be considered thread-safe,

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-malloc.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Options
3535
.. option:: Allocations
3636

3737
Semicolon-separated list of fully qualified names of memory allocation functions.
38-
Defaults to ``::malloc;::calloc``.
38+
Defaults to `::malloc;::calloc`.
3939

4040
.. option:: Deallocations
4141

4242
Semicolon-separated list of fully qualified names of memory allocation functions.
43-
Defaults to ``::free``.
43+
Defaults to `::free`.
4444

4545
.. option:: Reallocations
4646

4747
Semicolon-separated list of fully qualified names of memory allocation functions.
48-
Defaults to ``::realloc``.
48+
Defaults to `::realloc`.

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/owning-memory.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ Options
9595

9696
Semicolon-separated list of fully qualified names of legacy functions that create
9797
resources but cannot introduce ``gsl::owner<>``.
98-
Defaults to ``::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile``.
98+
Defaults to `::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile`.
9999

100100

101101
.. option:: LegacyResourceConsumers
102102

103103
Semicolon-separated list of fully qualified names of legacy functions expecting
104104
resource owners as pointer arguments but cannot introduce ``gsl::owner<>``.
105-
Defaults to ``::free;::realloc;::freopen;::fclose``.
105+
Defaults to `::free;::realloc;::freopen;::fclose`.
106106

107107

108108
Limitations

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Options
2121

2222
The check can generate fixes after this option has been set to the name of
2323
the include file that contains ``gsl::at()``, e.g. `"gsl/gsl.h"`.
24+
Default is an empty string.
2425

2526
.. option:: IncludeStyle
2627

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Options
3737

3838
If set to `true`, the check will provide fix-its with literal initializers
3939
\( ``int i = 0;`` \) instead of curly braces \( ``int i{};`` \).
40+
Default is `false`.
4041

4142
This rule is part of the `Type safety (Type.6)
4243
<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Pro-type-memberinit>`_

clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Options
4545

4646
A semicolon-separated list of qualified types which should not be allowed to
4747
persist across suspension points.
48-
Eg: ``my::lockable; a::b;::my::other::lockable;``
49-
The default value of this option is `"std::lock_guard;std::scoped_lock"`.
48+
Eg: `my::lockable;a::b;::my::other::lockable`
49+
The default value of this option is `std::lock_guard;std::scoped_lock`.
5050

5151
.. option:: AllowedAwaitablesList
5252

@@ -78,6 +78,6 @@ Options
7878
co_await wait();
7979
}
8080

81-
Eg: ``my::safe::awaitable;other::awaitable``
82-
The default value of this option is empty string `""`.
81+
Eg: `my::safe::awaitable;other::awaitable`
82+
Default is an empty string.
8383

clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Options
3131

3232
A semicolon-separated list of regexes to disable insertion/removal of header
3333
files that match this regex as a suffix. E.g., `foo/.*` disables
34-
insertion/removal for all headers under the directory `foo`. By default, no
35-
headers will be ignored.
34+
insertion/removal for all headers under the directory `foo`. Default is an
35+
empty string, no headers will be ignored.
3636

3737
.. option:: DeduplicateFindings
3838

clang-tools-extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Options
1717

1818
.. option:: IgnoreClassesWithAllMemberVariablesBeingPublic
1919

20-
Allows to completely ignore classes if **all** the member variables in that
21-
class a declared with a ``public`` access specifier.
20+
When `true`, allows to completely ignore classes if **all** the member
21+
variables in that class declared with a ``public`` access specifier.
22+
Default is `false`.
2223

2324
.. option:: IgnorePublicMemberVariables
2425

25-
Allows to ignore (not diagnose) **all** the member variables declared with
26-
a ``public`` access specifier.
26+
When `true`, allows to ignore (not diagnose) **all** the member variables
27+
declared with a ``public`` access specifier. Default is `false`.

clang-tools-extra/docs/clang-tidy/checks/readability/container-data-pointer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ Options
1818
.. option:: IgnoredContainers
1919

2020
Semicolon-separated list of containers regexp for which this check won't be
21-
enforced. Default is `empty`.
21+
enforced. Default is an empty string.

clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ The check issues warning if a container has ``empty()`` and ``size()`` or
2525

2626
`size_type` can be any kind of integer type.
2727

28+
Options
29+
-------
30+
2831
.. option:: ExcludedComparisonTypes
2932

3033
A semicolon-separated list of class names for which the check will ignore

clang-tools-extra/docs/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ In the case of multiple redeclarations or function template specializations,
5252
a warning is issued for every redeclaration or specialization inconsistent with
5353
the definition or the first declaration seen in a translation unit.
5454

55+
Options
56+
-------
57+
5558
.. option:: IgnoreMacros
5659

5760
If this option is set to `true` (default is `true`), the check will not warn

clang-tools-extra/docs/clang-tidy/checks/readability/redundant-inline-specifier.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ Options
2929
.. option:: StrictMode
3030

3131
If set to `true`, the check will also flag functions and variables that
32-
already have internal linkage as redundant.
32+
already have internal linkage as redundant. Default is `false`.

clang-tools-extra/docs/clang-tidy/checks/readability/redundant-smartptr-get.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Examples:
1414
*ptr->get() ==> **ptr
1515
if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...
1616
17+
Options
18+
-------
1719

1820
.. option:: IgnoreMacros
1921

0 commit comments

Comments
 (0)