Skip to content

[clang-tidy][NFC][doc] improve "options" sections of misc-, cppcore- and other checks #133694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ Options
.. option:: RetryMacros

A comma-separated list of the names of retry macros to be checked.
Default is `TEMP_FAILURE_RETRY`.
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Options
.. option:: DisallowedSeedTypes

A comma-separated list of the type names which are disallowed.
Default values are ``time_t``, ``std::time_t``.
Default value is `time_t,std::time_t`.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Examples:

sleep(1); // implementation may use SIGALRM

Options
-------

.. option:: FunctionSet

Specifies which functions in libc should be considered thread-safe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ Options
.. option:: Allocations

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

.. option:: Deallocations

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

.. option:: Reallocations

Semicolon-separated list of fully qualified names of memory allocation functions.
Defaults to ``::realloc``.
Defaults to `::realloc`.
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ Options

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


.. option:: LegacyResourceConsumers

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


Limitations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Options

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

.. option:: IncludeStyle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Options

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

This rule is part of the `Type safety (Type.6)
<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Pro-type-memberinit>`_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Options

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

.. option:: AllowedAwaitablesList

Expand Down Expand Up @@ -78,6 +78,6 @@ Options
co_await wait();
}

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

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Options

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

.. option:: DeduplicateFindings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Options

.. option:: IgnoreClassesWithAllMemberVariablesBeingPublic

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

.. option:: IgnorePublicMemberVariables

Allows to ignore (not diagnose) **all** the member variables declared with
a ``public`` access specifier.
When `true`, allows to ignore (not diagnose) **all** the member variables
declared with a ``public`` access specifier. Default is `false`.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Options
.. option:: IgnoredContainers

Semicolon-separated list of containers regexp for which this check won't be
enforced. Default is `empty`.
enforced. Default is an empty string.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ The check issues warning if a container has ``empty()`` and ``size()`` or

`size_type` can be any kind of integer type.

Options
-------

.. option:: ExcludedComparisonTypes

A semicolon-separated list of class names for which the check will ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ In the case of multiple redeclarations or function template specializations,
a warning is issued for every redeclaration or specialization inconsistent with
the definition or the first declaration seen in a translation unit.

Options
-------

.. option:: IgnoreMacros

If this option is set to `true` (default is `true`), the check will not warn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ Options
.. option:: StrictMode

If set to `true`, the check will also flag functions and variables that
already have internal linkage as redundant.
already have internal linkage as redundant. Default is `false`.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Examples:
*ptr->get() ==> **ptr
if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...

Options
-------

.. option:: IgnoreMacros

Expand Down