-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[clang-tidy][NFC] Clarify some options use regex to matching in doc (1/N) #161142
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
Open
flovent
wants to merge
4
commits into
llvm:main
Choose a base branch
from
flovent:tidy-clarify-regex-in-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clang-tidy Author: None (flovent) ChangesSome checks use regular expressions to match option values in their implementation but this is not documented, it might makes user confused. Full diff: https://github.com/llvm/llvm-project/pull/161142.diff 5 Files Affected:
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
index 556d90213b216..b64158ded6100 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
@@ -39,8 +39,8 @@ Options
.. option:: ExcludeClasses
- Semicolon-delimited list of class names for overwriting the default
- exclusion list. The default is:
+ Semicolon-delimited list of regular expressions matching class names that
+ overwriting the default exclusion list. The default is:
`::std::map;::std::unordered_map;::std::flat_map`.
.. option:: FixMode
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst
index cfa11d3cac8bf..fb46d73071a53 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst
@@ -62,12 +62,12 @@ Options
.. option:: StrFormatLikeFunctions
- A semicolon-separated list of (fully qualified) function names to
- replace, with the requirement that the first parameter contains the
- printf-style format string and the arguments to be formatted follow
- immediately afterwards. Qualified member function names are supported,
- but the replacement function name must be unqualified. The default value
- for this option is `absl::StrFormat`.
+ A semicolon-separated list of regular expressions matching the
+ (fully qualified) names of functions to replace, with the requirement that
+ the first parameter contains the printf-style format string and the
+ arguments to be formatted follow immediately afterwards. Qualified member
+ function names are supported, but the replacement function name must be
+ unqualified. The default value for this option is `absl::StrFormat`.
.. option:: ReplacementFormatFunction
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
index 0cf51e3961a05..9d09b1ee718b7 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
@@ -122,25 +122,27 @@ Options
.. option:: PrintfLikeFunctions
- A semicolon-separated list of (fully qualified) function names to
- replace, with the requirement that the first parameter contains the
- printf-style format string and the arguments to be formatted follow
- immediately afterwards. Qualified member function names are supported,
- but the replacement function name must be unqualified. If neither this
- option nor `FprintfLikeFunctions` are set then the default value for
- this option is `printf; absl::PrintF`, otherwise it is empty.
+ A semicolon-separated list of regular expressions matching the
+ (fully qualified) names of functions to replace, with the requirement
+ that the first parameter contains the printf-style format string and the
+ arguments to be formatted follow immediately afterwards. Qualified member
+ function names are supported, but the replacement function name must be
+ unqualified. If neither this option nor `FprintfLikeFunctions` are set then
+ the default value for this option is `printf; absl::PrintF`, otherwise it is
+ empty.
.. option:: FprintfLikeFunctions
- A semicolon-separated list of (fully qualified) function names to
- replace, with the requirement that the first parameter is retained, the
- second parameter contains the printf-style format string and the
- arguments to be formatted follow immediately afterwards. Qualified
- member function names are supported, but the replacement function name
- must be unqualified. If neither this option nor `PrintfLikeFunctions`
- are set then the default value for this option is `fprintf;
- absl::FPrintF`, otherwise it is empty.
+ A semicolon-separated list of regular expressions matching the
+ (fully qualified) names of functions to replace, with the requirement
+ that the first parameter is retained, the second parameter contains the
+ printf-style format string and the arguments to be formatted follow
+ immediately afterwards. Qualified member function names are supported,
+ but the replacement function name must be unqualified. If neither this
+ option nor `PrintfLikeFunctions` are set then the default value for this
+ option is `fprintf;absl::FPrintF`, otherwise it is empty.
+
.. option:: ReplacementPrintFunction
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst
index da6f770b3d74b..211f19203d814 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst
@@ -30,8 +30,8 @@ Options
.. option:: ExcludedComparisonTypes
- A semicolon-separated list of class names for which the check will ignore
- comparisons of objects with default-constructed objects of the same type.
- If a class is listed here, the check will not suggest using ``empty()``
- instead of such comparisons for objects of that class.
- Default value is: `::std::array`.
+ A semicolon-separated list of regular expressions matching class names that
+ the check will ignore comparisons of objects with default-constructed
+ objects of the same type. If a class is listed here, the check will not
+ suggest using ``empty()`` instead of such comparisons for objects of that
+ class. Default value is: `::std::array`.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-string-cstr.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-string-cstr.rst
index 2789f9c096ccf..7b507771d6799 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-string-cstr.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/redundant-string-cstr.rst
@@ -11,10 +11,10 @@ Options
.. option:: StringParameterFunctions
- A semicolon-separated list of (fully qualified) function/method/operator
- names, with the requirement that any parameter currently accepting a
- ``const char*`` input should also be able to accept ``std::string``
- inputs, or proper overload candidates that can do so should exist. This
- can be used to configure functions such as ``fmt::format``,
- ``spdlog::logger::info``, or wrappers around these and similar
- functions. The default value is the empty string.
+ A semicolon-separated list of regular expressions matching the
+ (fully qualified) names of function/method/operator, with the requirement
+ that any parameter currently accepting a ``const char*`` input should also
+ be able to accept ``std::string`` inputs, or proper overload candidates that
+ can do so should exist. This can be used to configure functions such as
+ ``fmt::format``, ``spdlog::logger::info``, or wrappers around these and
+ similar functions. The default value is the empty string.
|
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst
Outdated
Show resolved
Hide resolved
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
Outdated
Show resolved
Hide resolved
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
localspook
reviewed
Sep 29, 2025
...tra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
Outdated
Show resolved
Hide resolved
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
Outdated
Show resolved
Hide resolved
clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst
Outdated
Show resolved
Hide resolved
...tra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst
Outdated
Show resolved
Hide resolved
clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Victor Chernyakin <chernyakin.victor.j@outlook.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some checks use regular expressions to match option values in their implementation but this is not documented, it might makes user confused.
See #160991 (comment)