https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/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. >From 3f2086a843ccbc2dca5185199bbb91c366bcae06 Mon Sep 17 00:00:00 2001 From: Victor Baranov <bar.victor.2...@gmail.com> Date: Mon, 31 Mar 2025 13:12:23 +0300 Subject: [PATCH] [clang-tidy] improve docs for various checks --- .../checks/android/comparison-in-temp-failure-retry.rst | 1 + .../docs/clang-tidy/checks/cert/msc51-cpp.rst | 2 +- .../docs/clang-tidy/checks/concurrency/mt-unsafe.rst | 3 +++ .../clang-tidy/checks/cppcoreguidelines/no-malloc.rst | 6 +++--- .../checks/cppcoreguidelines/owning-memory.rst | 4 ++-- .../pro-bounds-constant-array-index.rst | 1 + .../checks/cppcoreguidelines/pro-type-member-init.rst | 1 + .../clang-tidy/checks/misc/coroutine-hostile-raii.rst | 8 ++++---- .../docs/clang-tidy/checks/misc/include-cleaner.rst | 4 ++-- .../misc/non-private-member-variables-in-classes.rst | 9 +++++---- 10 files changed, 23 insertions(+), 16 deletions(-) diff --git a/clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst b/clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst index 93112ee2bea64..31cc72b0579c4 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/android/comparison-in-temp-failure-retry.rst @@ -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`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert/msc51-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert/msc51-cpp.rst index 1e0e34efe0a58..99e550aef0e7a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert/msc51-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert/msc51-cpp.rst @@ -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`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/concurrency/mt-unsafe.rst b/clang-tools-extra/docs/clang-tidy/checks/concurrency/mt-unsafe.rst index 4e46ba1edc34f..337be787d962b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/concurrency/mt-unsafe.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/concurrency/mt-unsafe.rst @@ -32,6 +32,9 @@ Examples: sleep(1); // implementation may use SIGALRM +Options +------- + .. option:: FunctionSet Specifies which functions in libc should be considered thread-safe, diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-malloc.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-malloc.rst index 237520aa6690a..e3a162078a3b8 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-malloc.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/no-malloc.rst @@ -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`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/owning-memory.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/owning-memory.rst index 3c91d09dda1f2..4fc49f8bd6eee 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/owning-memory.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/owning-memory.rst @@ -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 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 4e877676cf1fe..9b82e0c45a314 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 @@ -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 diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.rst index 97af01a895e1c..3c6797bce9450 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-type-member-init.rst @@ -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>`_ diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst index a39c1853b313c..53375b40f4d0e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst @@ -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 @@ -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` + The default value of this option is an empty string. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst index e40335b2543b2..d112f01cbc0b1 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst @@ -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 diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.rst index 57990622e60cd..9d5b7f6673159 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc/non-private-member-variables-in-classes.rst @@ -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`. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits