Skip to content

Commit 997c31e

Browse files
committedAug 31, 2016
[clang-tidy docs] Add missing option docs.
Reviewers: alexfh, Eugene.Zelenko, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D23918 llvm-svn: 280236
1 parent 544a8d0 commit 997c31e

19 files changed

+217
-12
lines changed
 

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

+5
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ Options
1818

1919
The check can generate fixes after this option has been set to the name of
2020
the include file that contains ``gsl::at()``, e.g. `"gsl/gsl.h"`.
21+
22+
.. option:: IncludeStyle
23+
24+
A string specifying which include-style is used, `llvm` or `google`. Default
25+
is `llvm`.

‎clang-tools-extra/docs/clang-tidy/checks/google-build-namespaces.rst

+11
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ Finds anonymous namespaces in headers.
1010
https://google.github.io/styleguide/cppguide.html#Namespaces
1111

1212
Corresponding cpplint.py check name: `build/namespaces`.
13+
14+
Options
15+
-------
16+
17+
.. option:: HeaderFileExtensions
18+
19+
A comma-separated list of filename extensions of header files (the filename
20+
extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
21+
For header files without an extension, use an empty string (if there are no
22+
other desired extensions) or leave an empty element in the list. e.g.,
23+
"h,hh,hpp,hxx," (note the trailing comma).

‎clang-tools-extra/docs/clang-tidy/checks/google-global-names-in-headers.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Options
1515
.. option:: HeaderFileExtensions
1616

1717
A comma-separated list of filename extensions of header files (the filename
18-
extensions should not contain "." prefix). "h" by default. For extension-less
19-
header files, using an empty string or leaving an empty string between ","
20-
if there are other filename extensions.
18+
extensions should not contain "." prefix). Default is "h".
19+
For header files without an extension, use an empty string (if there are no
20+
other desired extensions) or leave an empty element in the list. e.g.,
21+
"h,hh,hpp,hxx," (note the trailing comma).

‎clang-tools-extra/docs/clang-tidy/checks/google-runtime-int.rst

+15
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@ The corresponding style guide rule:
1010
https://google.github.io/styleguide/cppguide.html#Integer_Types.
1111

1212
Correspondig cpplint.py check: `runtime/int`.
13+
14+
Options
15+
-------
16+
17+
.. option:: UnsignedTypePrefix
18+
19+
A string specifying the unsigned type prefix. Default is `uint`.
20+
21+
.. option:: SignedTypePrefix
22+
23+
A string specifying the signed type prefix. Default is `int`.
24+
25+
.. option:: TypeSuffix
26+
27+
A string specifying the type suffix. Default is an empty string.

‎clang-tools-extra/docs/clang-tidy/checks/list.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. title:: clang-tidy - Clang-Tidy Checks
22

33
Clang-Tidy Checks
4-
=========================
4+
=================
55

66
.. toctree::
77
boost-use-to-string

‎clang-tools-extra/docs/clang-tidy/checks/llvm-header-guard.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Options
1010

1111
.. option:: HeaderFileExtensions
1212

13-
A comma-separated list of filename extensions of header files (The filename
14-
extension should not contain "." prefix). Default value is ",h,hh,hpp,hxx".
15-
For extension-less header files, using an empty string or leaving an empty
16-
string between "," if there are other filename extensions.
13+
A comma-separated list of filename extensions of header files (the filename
14+
extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
15+
For header files without an extension, use an empty string (if there are no
16+
other desired extensions) or leave an empty element in the list. e.g.,
17+
"h,hh,hpp,hxx," (note the trailing comma).

‎clang-tools-extra/docs/clang-tidy/checks/llvm-namespace-comment.rst

+15
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,18 @@ Checks that long namespaces have a closing comment.
1111
http://llvm.org/docs/CodingStandards.html#namespace-indentation
1212

1313
https://google.github.io/styleguide/cppguide.html#Namespaces
14+
15+
Options
16+
-------
17+
18+
.. option:: ShortNamespaceLines
19+
20+
Requires the closing brace of the namespace definition to be followed by a
21+
closing comment if the body of the namespace has more than
22+
`ShortNamespaceLines` lines of code. The value is an unsigned integer that
23+
defaults to `1U`.
24+
25+
.. option:: SpacesBeforeComments
26+
27+
An unsigned integer specifying the number of spaces before the comment
28+
closing a namespace definition. Default is `1U`.

‎clang-tools-extra/docs/clang-tidy/checks/misc-definitions-in-headers.rst

+16
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,19 @@ from multiple translation units.
7373
// OK: member function definition of a class template is allowed.
7474
template <typename T>
7575
void B<T>::f1() {}
76+
77+
Options
78+
-------
79+
80+
.. option:: HeaderFileExtensions
81+
82+
A comma-separated list of filename extensions of header files (the filename
83+
extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
84+
For header files without an extension, use an empty string (if there are no
85+
other desired extensions) or leave an empty element in the list. e.g.,
86+
"h,hh,hpp,hxx," (note the trailing comma).
87+
88+
.. option:: UseHeaderFileExtension
89+
90+
When non-zero, the check will use the file extension to distinguish header
91+
files. Default is `1`.

‎clang-tools-extra/docs/clang-tidy/checks/misc-move-constructor-init.rst

+15
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,18 @@ move constructor.
1111

1212
It also flags constructor arguments that are passed by value, have a non-deleted
1313
move-constructor and are assigned to a class field by copy construction.
14+
15+
Options
16+
-------
17+
18+
.. option:: IncludeStyle
19+
20+
A string specifying which include-style is used, `llvm` or `google`. Default
21+
is `llvm`.
22+
23+
.. option:: UseCERTSemantics
24+
25+
When non-zero, the check conforms to the behavior expected by the CERT secure
26+
coding recommendation
27+
`OOP11-CPP <https://www.securecoding.cert.org/confluence/display/cplusplus/OOP11-CPP.+Do+not+copy-initialize+members+or+base+classes+from+a+move+constructor>`_.
28+
Default is `0` for misc-move-constructor-init and `1` for cert-oop11-cpp.

‎clang-tools-extra/docs/clang-tidy/checks/misc-sizeof-expression.rst

+19
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,22 @@ hidden through macros.
133133
void getInt(int* dst) {
134134
memcpy(dst, buf, sizeof(INT_SZ)); // sizeof(sizeof(int)) is suspicious.
135135
}
136+
137+
Options
138+
-------
139+
140+
.. option:: WarnOnSizeOfConstant
141+
142+
When non-zero, the check will warn on an expression like
143+
``sizeof(CONSTANT)``. Default is `1`.
144+
145+
.. option:: WarnOnSizeOfThis
146+
147+
When non-zero, the check will warn on an expression like ``sizeof(this)``.
148+
Default is `1`.
149+
150+
.. option:: WarnOnSizeOfCompareToConstant
151+
152+
When non-zero, the check will warn on an expression like
153+
``sizeof(epxr) <= k`` for a suspicious constant `k` while `k` is `0` or
154+
greater than `0x8000`. Default is `1`.

‎clang-tools-extra/docs/clang-tidy/checks/misc-string-constructor.rst

+13-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Examples:
1111

1212
.. code-block:: c++
1313

14-
std::string('x', 50) str; // should be std::string(50, 'x')
14+
std::string('x', 50) str; // should be std::string(50, 'x')
1515

1616
Calling the string-literal constructor with a length bigger than the literal is
1717
suspicious and adds extra random characters to the string.
@@ -30,3 +30,15 @@ Examples:
3030
.. code-block:: c++
3131

3232
std::string("test", 0); // Creation of an empty string.
33+
34+
Options
35+
-------
36+
37+
.. option:: WarnOnLargeLength
38+
39+
When non-zero, the check will warn on a string with a length greater than
40+
`LargeLengthThreshold`. Default is `1`.
41+
42+
.. option:: LargeLengthThreshold
43+
44+
An integer specifying the large length threshold. Default is `0x800000`.

‎clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-missing-comma.rst

+18
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,21 @@ This check may warn incorrectly on cases like:
3939
"Code " PRIu64, // May warn here.
4040
"Warning %s",
4141
};
42+
43+
Options
44+
-------
45+
46+
.. option:: SizeThreshold
47+
48+
An unsigned integer specifying the minimum size of a string literal to be
49+
considered by the check. Default is `5U`.
50+
51+
.. option:: RatioThreshold
52+
53+
A string specifying the maximum threshold ratio [0, 1.0] of suspicious string
54+
literals to be considered. Default is `".2"`.
55+
56+
.. option:: MaxConcatenatedTokens
57+
58+
An unsigned integer specifying the maximum number of concatenated tokens.
59+
Default is `5U`.

‎clang-tools-extra/docs/clang-tidy/checks/misc-suspicious-string-compare.rst

+26
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,29 @@ a wrong context.
3636
.. code-block:: c++
3737

3838
if (strcmp(...) < 0.) // Incorrect usage of the returned value.
39+
40+
Options
41+
-------
42+
43+
.. option:: WarnOnImplicitComparison
44+
45+
When non-zero, the check will warn on implicit comparison. `1` by default.
46+
47+
.. option:: WarnOnLogicalNotComparison
48+
49+
When non-zero, the check will warn on logical not comparison. `0` by default.
50+
51+
.. option:: StringCompareLikeFunctions
52+
53+
A string specifying the comma-separated names of the extra string comparison
54+
functions. Default is an empty string.
55+
The check will detect the following string comparison functions:
56+
`__builtin_memcmp`, `__builtin_strcasecmp`, `__builtin_strcmp`,
57+
`__builtin_strncasecmp`, `__builtin_strncmp`, `_mbscmp`, `_mbscmp_l`,
58+
`_mbsicmp`, `_mbsicmp_l`, `_mbsnbcmp`, `_mbsnbcmp_l`, `_mbsnbicmp`,
59+
`_mbsnbicmp_l`, `_mbsncmp`, `_mbsncmp_l`, `_mbsnicmp`, `_mbsnicmp_l`,
60+
`_memicmp`, `_memicmp_l`, `_stricmp`, `_stricmp_l`, `_strnicmp`,
61+
`_strnicmp_l`, `_wcsicmp`, `_wcsicmp_l`, `_wcsnicmp`, `_wcsnicmp_l`,
62+
`lstrcmp`, `lstrcmpi`, `memcmp`, `memicmp`, `strcasecmp`, `strcmp`,
63+
`strcmpi`, `stricmp`, `strncasecmp`, `strncmp`, `strnicmp`, `wcscasecmp`,
64+
`wcscmp`, `wcsicmp`, `wcsncmp`, `wcsnicmp`, `wmemcmp`.

‎clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst

+8
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,11 @@ Example:
151151
For more information about the pass-by-value idiom, read: `Want Speed? Pass by Value`_.
152152

153153
.. _Want Speed? Pass by Value: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/
154+
155+
Options
156+
-------
157+
158+
.. option:: IncludeStyle
159+
160+
A string specifying which include-style is used, `llvm` or `google`. Default
161+
is `llvm`.

‎clang-tools-extra/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst

+7
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ Known Limitations
7070

7171
// only 'f<int>()' (or similar) will trigger the replacement.
7272

73+
Options
74+
-------
75+
76+
.. option:: IncludeStyle
77+
78+
A string specifying which include-style is used, `llvm` or `google`. Default
79+
is `llvm`.

‎clang-tools-extra/docs/clang-tidy/checks/performance-for-range-copy.rst

+8
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ following heuristic is employed:
1717
2. The loop variable is not const, but only const methods or operators are
1818
invoked on it, or it is used as const reference or value argument in
1919
constructors or function calls.
20+
21+
Options
22+
-------
23+
24+
.. option:: WarnOnAllAutoCopies
25+
26+
When non-zero, warns on any use of `auto` as the type of the range-based for
27+
loop variable. Default is `0`.

‎clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst

+11-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ performance-inefficient-string-concatenation
55

66
This check warns about the performance overhead arising from concatenating
77
strings using the ``operator+``, for instance:
8-
8+
99
.. code-block:: c++
1010

1111
std::string a("Foo"), b("Bar");
1212
a = a + b;
1313

1414
Instead of this structure you should use ``operator+=`` or ``std::string``'s
1515
(``std::basic_string``) class member function ``append()``. For instance:
16-
16+
1717
.. code-block:: c++
1818

1919
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@ Could be rewritten in a greatly more efficient way like:
2828
std::string a("Foo"), b("Baz");
2929
for (int i = 0; i < 20000; ++i) {
3030
a.append("Bar").append(b);
31-
}
31+
}
3232

3333
And this can be rewritten too:
3434

@@ -49,3 +49,11 @@ In a slightly more efficient way like:
4949
void g() {
5050
f(std::string(a).append("Bar").append(b));
5151
}
52+
53+
Options
54+
-------
55+
56+
.. option:: StrictMode
57+
58+
When zero, the check will only check the string usage in ``while``, ``for``
59+
and ``for-range`` statements. Default is `0`.

‎clang-tools-extra/docs/clang-tidy/checks/performance-unnecessary-value-param.rst

+8
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ Will become:
5353
void setValue(string Value) {
5454
Field = std::move(Value);
5555
}
56+
57+
Options
58+
-------
59+
60+
.. option:: IncludeStyle
61+
62+
A string specifying which include-style is used, `llvm` or `google`. Default
63+
is `llvm`.

‎clang-tools-extra/docs/clang-tidy/checks/readability-implicit-bool-cast.rst

+12
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,15 @@ Some additional accommodations are made for pre-C++11 dialects:
116116

117117
Occurrences of implicit casts inside macros and template instantiations are
118118
deliberately ignored, as it is not clear how to deal with such cases.
119+
120+
Options
121+
-------
122+
123+
.. option:: AllowConditionalIntegerCasts
124+
125+
When non-zero, the check will allow conditional integer casts. Default is
126+
`0`.
127+
128+
.. option:: AllowConditionalPointerCasts
129+
130+
When non-zero, the check will allow conditional pointer casts. Default is `0`.

0 commit comments

Comments
 (0)
Please sign in to comment.