Skip to content

Commit 1f2bdff

Browse files
floventEugeneZelenkolocalspook
authored
[clang-tidy][NFC] Clarify some options use regex to matching in doc (1/N) (llvm#161142)
Some checks use regular expressions to match option values in their implementation ​​but this is not documented, it might makes user confused. See llvm#160991 (comment) --------- Co-authored-by: EugeneZelenko <[email protected]> Co-authored-by: Victor Chernyakin <[email protected]>
1 parent 616b5ec commit 1f2bdff

File tree

5 files changed

+37
-35
lines changed

5 files changed

+37
-35
lines changed

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/pro-bounds-avoid-unchecked-container-access.rst

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

4040
.. option:: ExcludeClasses
4141

42-
Semicolon-delimited list of class names for overwriting the default
43-
exclusion list. The default is:
42+
Semicolon-separated list of regular expressions matching class names that
43+
overwrites the default exclusion list. The default is:
4444
`::std::map;::std::unordered_map;::std::flat_map`.
4545

4646
.. option:: FixMode

clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-format.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ Options
6262

6363
.. option:: StrFormatLikeFunctions
6464

65-
A semicolon-separated list of (fully qualified) function names to
66-
replace, with the requirement that the first parameter contains the
67-
printf-style format string and the arguments to be formatted follow
68-
immediately afterwards. Qualified member function names are supported,
69-
but the replacement function name must be unqualified. The default value
70-
for this option is `absl::StrFormat`.
65+
A semicolon-separated list of regular expressions matching the
66+
(fully qualified) names of functions to replace, with the requirement that
67+
the first parameter contains the printf-style format string and the
68+
arguments to be formatted follow immediately afterwards. Qualified member
69+
function names are supported, but the replacement function name must be
70+
unqualified. The default value is `absl::StrFormat`.
7171

7272
.. option:: ReplacementFormatFunction
7373

clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,27 @@ Options
122122

123123
.. option:: PrintfLikeFunctions
124124

125-
A semicolon-separated list of (fully qualified) function names to
126-
replace, with the requirement that the first parameter contains the
127-
printf-style format string and the arguments to be formatted follow
128-
immediately afterwards. Qualified member function names are supported,
129-
but the replacement function name must be unqualified. If neither this
130-
option nor `FprintfLikeFunctions` are set then the default value for
131-
this option is `printf; absl::PrintF`, otherwise it is empty.
125+
A semicolon-separated list of regular expressions matching the
126+
(fully qualified) names of functions to replace, with the requirement
127+
that the first parameter contains the printf-style format string and the
128+
arguments to be formatted follow immediately afterwards. Qualified member
129+
function names are supported, but the replacement function name must be
130+
unqualified. If neither this option nor `FprintfLikeFunctions` are set then
131+
the default value is `printf; absl::PrintF`, otherwise it is the empty
132+
string.
132133

133134

134135
.. option:: FprintfLikeFunctions
135136

136-
A semicolon-separated list of (fully qualified) function names to
137-
replace, with the requirement that the first parameter is retained, the
138-
second parameter contains the printf-style format string and the
139-
arguments to be formatted follow immediately afterwards. Qualified
140-
member function names are supported, but the replacement function name
141-
must be unqualified. If neither this option nor `PrintfLikeFunctions`
142-
are set then the default value for this option is `fprintf;
143-
absl::FPrintF`, otherwise it is empty.
137+
A semicolon-separated list of regular expressions matching the
138+
(fully qualified) names of functions to replace, with the requirement
139+
that the first parameter is retained, the second parameter contains the
140+
printf-style format string and the arguments to be formatted follow
141+
immediately afterwards. Qualified member function names are supported,
142+
but the replacement function name must be unqualified. If neither this
143+
option nor `PrintfLikeFunctions` are set then the default value is
144+
`fprintf;absl::FPrintF`, otherwise it is the empty string.
145+
144146

145147
.. option:: ReplacementPrintFunction
146148

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Options
3030

3131
.. option:: ExcludedComparisonTypes
3232

33-
A semicolon-separated list of class names for which the check will ignore
34-
comparisons of objects with default-constructed objects of the same type.
35-
If a class is listed here, the check will not suggest using ``empty()``
36-
instead of such comparisons for objects of that class.
37-
Default value is: `::std::array`.
33+
A semicolon-separated list of regular expressions matching class names for
34+
which the check will ignore comparisons of objects with default-constructed
35+
objects of the same type. If a class is listed here, the check will not
36+
suggest using ``empty()`` instead of such comparisons for objects of that
37+
class. Default value is: `::std::array`.

clang-tools-extra/docs/clang-tidy/checks/readability/redundant-string-cstr.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Options
1111

1212
.. option:: StringParameterFunctions
1313

14-
A semicolon-separated list of (fully qualified) function/method/operator
15-
names, with the requirement that any parameter currently accepting a
16-
``const char*`` input should also be able to accept ``std::string``
17-
inputs, or proper overload candidates that can do so should exist. This
18-
can be used to configure functions such as ``fmt::format``,
19-
``spdlog::logger::info``, or wrappers around these and similar
20-
functions. The default value is the empty string.
14+
A semicolon-separated list of regular expressions matching the
15+
(fully qualified) names of function/method/operator, with the requirement
16+
that any parameter currently accepting a ``const char*`` input should also
17+
be able to accept ``std::string`` inputs, or proper overload candidates that
18+
can do so should exist. This can be used to configure functions such as
19+
``fmt::format``, ``spdlog::logger::info``, or wrappers around these and
20+
similar functions. The default value is the empty string.

0 commit comments

Comments
 (0)