Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.
Closed by commit rL280236: [clang-tidy docs] Add missing option docs. (authored 
by hokein).

Changed prior to commit:
  https://reviews.llvm.org/D23918?vs=69839=69840#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23918

Files:
  
clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-namespaces.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/google-global-names-in-headers.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/google-runtime-int.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/list.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/llvm-header-guard.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/llvm-namespace-comment.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/misc-definitions-in-headers.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/misc-move-constructor-init.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/misc-sizeof-expression.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/misc-string-constructor.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-pass-by-value.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  clang-tools-extra/trunk/docs/clang-tidy/checks/performance-for-range-copy.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  
clang-tools-extra/trunk/docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- clang-tools-extra/trunk/docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -5,15 +5,15 @@
 
 This check warns about the performance overhead arising from concatenating
 strings using the ``operator+``, for instance:
-
+
 .. code-block:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s
 (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code-block:: c++
 
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -49,3 +49,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- clang-tools-extra/trunk/docs/clang-tidy/checks/performance-for-range-copy.rst
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,11 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, warns on any use of `auto` as the type of the range-based for
+   loop variable. Default is `0`.
Index: clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-namespaces.rst
===
--- clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-namespaces.rst
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-namespaces.rst
@@ -10,3 +10,14 @@
 https://google.github.io/styleguide/cppguide.html#Namespaces
 
 Corresponding cpplint.py check name: `build/namespaces`.
+
+Options
+---
+
+.. option:: HeaderFileExtensions
+
+   A comma-separated list of filename extensions of header files (the filename
+   extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
+   For header files without an extension, use an empty string (if there are no
+   other desired extensions) or leave an empty element in the list. e.g.,
+   "h,hh,hpp,hxx," (note the trailing comma).
Index: clang-tools-extra/trunk/docs/clang-tidy/checks/google-runtime-int.rst
===
--- clang-tools-extra/trunk/docs/clang-tidy/checks/google-runtime-int.rst
+++ 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein updated this revision to Diff 69839.
hokein added a comment.

Update HeaderFileExtensions doc for all documents.


https://reviews.llvm.org/D23918

Files:
  docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-global-names-in-headers.rst
  docs/clang-tidy/checks/google-runtime-int.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-header-guard.rst
  docs/clang-tidy/checks/llvm-namespace-comment.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-sizeof-expression.rst
  docs/clang-tidy/checks/misc-string-constructor.rst
  docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  docs/clang-tidy/checks/modernize-pass-by-value.rst
  docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  docs/clang-tidy/checks/performance-for-range-copy.rst
  docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: docs/clang-tidy/checks/readability-implicit-bool-cast.rst
===
--- docs/clang-tidy/checks/readability-implicit-bool-cast.rst
+++ docs/clang-tidy/checks/readability-implicit-bool-cast.rst
@@ -116,3 +116,15 @@
 
 Occurrences of implicit casts inside macros and template instantiations are
 deliberately ignored, as it is not clear how to deal with such cases.
+
+Options
+---
+
+.. option::  AllowConditionalIntegerCasts
+
+   When non-zero, the check will allow conditional integer casts. Default is
+   `0`.
+
+.. option::  AllowConditionalPointerCasts
+
+   When non-zero, the check will allow conditional pointer casts. Default is `0`.
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -53,3 +53,11 @@
   void setValue(string Value) {
 Field = std::move(Value);
   }
+
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -5,15 +5,15 @@
 
 This check warns about the performance overhead arising from concatenating
 strings using the ``operator+``, for instance:
-
+
 .. code-block:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s
 (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code-block:: c++
 
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -49,3 +49,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- docs/clang-tidy/checks/performance-for-range-copy.rst
+++ docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,11 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, warns on any use of `auto` as the type of the range-based for
+   loop variable. Default is `0`.
Index: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
===
--- docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
+++ docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
@@ -70,3 +70,10 @@
 
  // only 'f()' (or similar) will trigger the replacement.
 
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/modernize-pass-by-value.rst
===
--- docs/clang-tidy/checks/modernize-pass-by-value.rst
+++ docs/clang-tidy/checks/modernize-pass-by-value.rst
@@ -151,3 +151,11 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein updated this revision to Diff 69838.
hokein marked 3 inline comments as done.
hokein added a comment.

Fix more comments.


https://reviews.llvm.org/D23918

Files:
  docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-runtime-int.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-header-guard.rst
  docs/clang-tidy/checks/llvm-namespace-comment.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-sizeof-expression.rst
  docs/clang-tidy/checks/misc-string-constructor.rst
  docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  docs/clang-tidy/checks/modernize-pass-by-value.rst
  docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  docs/clang-tidy/checks/performance-for-range-copy.rst
  docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: docs/clang-tidy/checks/readability-implicit-bool-cast.rst
===
--- docs/clang-tidy/checks/readability-implicit-bool-cast.rst
+++ docs/clang-tidy/checks/readability-implicit-bool-cast.rst
@@ -116,3 +116,15 @@
 
 Occurrences of implicit casts inside macros and template instantiations are
 deliberately ignored, as it is not clear how to deal with such cases.
+
+Options
+---
+
+.. option::  AllowConditionalIntegerCasts
+
+   When non-zero, the check will allow conditional integer casts. Default is
+   `0`.
+
+.. option::  AllowConditionalPointerCasts
+
+   When non-zero, the check will allow conditional pointer casts. Default is `0`.
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -53,3 +53,11 @@
   void setValue(string Value) {
 Field = std::move(Value);
   }
+
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -5,15 +5,15 @@
 
 This check warns about the performance overhead arising from concatenating
 strings using the ``operator+``, for instance:
-
+
 .. code-block:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s
 (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code-block:: c++
 
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -49,3 +49,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- docs/clang-tidy/checks/performance-for-range-copy.rst
+++ docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,11 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, warns on any use of `auto` as the type of the range-based for
+   loop variable. Default is `0`.
Index: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
===
--- docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
+++ docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
@@ -70,3 +70,10 @@
 
  // only 'f()' (or similar) will trigger the replacement.
 
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/modernize-pass-by-value.rst
===
--- docs/clang-tidy/checks/modernize-pass-by-value.rst
+++ docs/clang-tidy/checks/modernize-pass-by-value.rst
@@ -151,3 +151,11 @@
   For more information about the pass-by-value 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Aaron Ballman via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, thank you for the updated documentation!


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein marked an inline comment as done.


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
+   For header files without an extension, use an empty string (if there are no
+   other desired extensions) or leave an empty element in the list. e.g.,

All related documents have been updated now.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments.


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
+   For header files without an extension, use an empty string (if there are no
+   other desired extensions) or leave an empty element in the list. e.g.,

Okay, that make sense to me then. This change should also be applied to other 
places that have the extension list.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein added inline comments.


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
+   For header files without an extension, use an empty string (if there are no
+   other desired extensions) or leave an empty element in the list. e.g.,

aaron.ballman wrote:
> I may be confused then -- does the string "h,hh,hpp,hxx" (no trailing comma) 
> also wind up including header files without extensions? If so, we should 
> document that. If not, would adding a trailing comma cause it to include 
> header files without an extension? If so, that's what my example was trying 
> to point out, but perhaps my phrasing needs clarifying.
Aha, sorry, I misunderstood your words here. Yeah, we should add trailing `,` 
for the non-extension headers. 


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments.


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not include "." prefix). Default is "h,hh,hpp,hxx".
+   For header files without an extension, use an empty string (if there are no
+   other desired extensions) or leave an empty element in the list. e.g.,

I may be confused then -- does the string "h,hh,hpp,hxx" (no trailing comma) 
also wind up including header files without extensions? If so, we should 
document that. If not, would adding a trailing comma cause it to include header 
files without an extension? If so, that's what my example was trying to point 
out, but perhaps my phrasing needs clarifying.


Comment at: docs/clang-tidy/checks/misc-sizeof-expression.rst:154
@@ +153,2 @@
+   ``sizeof(epxr) <= k`` for a suspicious constant `k` while `k` is `0` or
+   bigger than `0x8000`. Default is `1`.

s/bigger than/greater than


Comment at: docs/clang-tidy/checks/performance-for-range-copy.rst:26
@@ +25,3 @@
+
+   When non-zero, warns on any use of auto as the type of the range-based for
+   loop variable. Default is `0`.

Should quote auto with backtics, I suppose.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein added a comment.

wow, thanks for many detailed comments.



Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not contain "." prefix). "h,hh,hpp,hxx" by default. For
+   extension-less header files, using an empty string or leaving an empty 
string
+   between "," if there are other filename extensions.

aaron.ballman wrote:
> How about:
> ```
> For header files without an extension, use an empty string (if there are no 
> other desired extensions) or leave an empty element in the list. e.g., 
> "h,hh,hpp,hxx," (note the trailing comma).
> ```
> (assuming my example actually works.)
The trailing comma in `h,hh,hpp,hxx,` is not required here.


Comment at: docs/clang-tidy/checks/misc-suspicious-missing-comma.rst:53
@@ +52,3 @@
+
+   A string represents maximal threshold ratio of suspicious string literals to
+   be considered. Default is `.2`.

aaron.ballman wrote:
> represents->specifying
> maximal->maximum
> 
> Should actually state that the string represents a floating-point value 
> between 0 and 1 (inclusive? exclusive?). Also, is it really a string? aka, 
> does it need quotes, or is it okay to not use quotes (as the default 
> suggests)?
Yeah, this is a string in the check's implementation.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-31 Thread Haojian Wu via cfe-commits
hokein updated this revision to Diff 69812.
hokein marked 26 inline comments as done.
hokein added a comment.

Address aaron's comments.


https://reviews.llvm.org/D23918

Files:
  docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-runtime-int.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-namespace-comment.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-sizeof-expression.rst
  docs/clang-tidy/checks/misc-string-constructor.rst
  docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  docs/clang-tidy/checks/modernize-pass-by-value.rst
  docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  docs/clang-tidy/checks/performance-for-range-copy.rst
  docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: docs/clang-tidy/checks/readability-implicit-bool-cast.rst
===
--- docs/clang-tidy/checks/readability-implicit-bool-cast.rst
+++ docs/clang-tidy/checks/readability-implicit-bool-cast.rst
@@ -116,3 +116,15 @@
 
 Occurrences of implicit casts inside macros and template instantiations are
 deliberately ignored, as it is not clear how to deal with such cases.
+
+Options
+---
+
+.. option::  AllowConditionalIntegerCasts
+
+   When non-zero, the check will allow conditional integer casts. Default is
+   `0`.
+
+.. option::  AllowConditionalPointerCasts
+
+   When non-zero, the check will allow conditional pointer casts. Default is `0`.
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -53,3 +53,11 @@
   void setValue(string Value) {
 Field = std::move(Value);
   }
+
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -5,15 +5,15 @@
 
 This check warns about the performance overhead arising from concatenating
 strings using the ``operator+``, for instance:
-
+
 .. code-block:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s
 (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code-block:: c++
 
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -49,3 +49,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- docs/clang-tidy/checks/performance-for-range-copy.rst
+++ docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,11 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, warns on any use of auto as the type of the range-based for
+   loop variable. Default is `0`.
Index: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
===
--- docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
+++ docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
@@ -70,3 +70,10 @@
 
  // only 'f()' (or similar) will trigger the replacement.
 
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string specifying which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/modernize-pass-by-value.rst
===
--- docs/clang-tidy/checks/modernize-pass-by-value.rst
+++ docs/clang-tidy/checks/modernize-pass-by-value.rst
@@ -151,3 +151,11 @@
   For more information about the pass-by-value idiom, read: `Want Speed? Pass by 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-30 Thread Aaron Ballman via cfe-commits
aaron.ballman requested changes to this revision.
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.
This revision now requires changes to proceed.

Thank you for working on this!



Comment at: 
docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst:24
@@ +23,3 @@
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.

s/represents/specifying


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:20
@@ +19,3 @@
+   A comma-separated list of filename extensions of header files (the filename
+   extensions should not contain "." prefix). "h,hh,hpp,hxx" by default. For
+   extension-less header files, using an empty string or leaving an empty 
string

s/not contain/not include the


Comment at: docs/clang-tidy/checks/google-build-namespaces.rst:21
@@ +20,3 @@
+   extensions should not contain "." prefix). "h,hh,hpp,hxx" by default. For
+   extension-less header files, using an empty string or leaving an empty 
string
+   between "," if there are other filename extensions.

How about:
```
For header files without an extension, use an empty string (if there are no 
other desired extensions) or leave an empty element in the list. e.g., 
"h,hh,hpp,hxx," (note the trailing comma).
```
(assuming my example actually works.)


Comment at: docs/clang-tidy/checks/google-runtime-int.rst:19
@@ +18,3 @@
+
+   A string represents unsigned type prefix. Default is `uint`.
+

A string specifying the unsigned type prefix.


Comment at: docs/clang-tidy/checks/google-runtime-int.rst:23
@@ +22,3 @@
+
+   A string represents singed type prefix. Default is `int`.
+

A string specifying the signed type prefix.


Comment at: docs/clang-tidy/checks/google-runtime-int.rst:27
@@ +26,2 @@
+
+   A string represents type suffix. Default is an empty string.

A string specifying the type suffix.


Comment at: docs/clang-tidy/checks/llvm-namespace-comment.rst:20
@@ +19,3 @@
+
+   An unsigned integer represents the maximal number of lines of the namespace
+   that is not required closing commments. Default is `1U`.

How about:
```
Requires the closing brace of the namespace definition to be followed by a 
closing comment if the body of the namespace has more than 
`ShortNamespaceLines` lines of code. The value is an unsigned integer that 
defaults to `1U`. 
```


Comment at: docs/clang-tidy/checks/llvm-namespace-comment.rst:25
@@ +24,2 @@
+
+   An unsigned integer represents spaces before comments. Default is `1U`.

How about:
```
An unsigned integer specifying the number of spaces before the comment closing 
a namespace definition.
```


Comment at: docs/clang-tidy/checks/misc-definitions-in-headers.rst:83
@@ +82,3 @@
+   A comma-separated list of filename extensions of header files (the filename
+   extensions should not contain "." prefix). "h,hh,hpp,hxx" by default. For
+   extension-less header files, using an empty string or leaving an empty 
string

Same suggestion here as above.


Comment at: docs/clang-tidy/checks/misc-definitions-in-headers.rst:89
@@ +88,3 @@
+
+   When non-zero, the check will use use file extension to distinguish header
+   files. Default is `1`.

s/use use/use the


Comment at: docs/clang-tidy/checks/misc-move-constructor-init.rst:20
@@ +19,3 @@
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.

s/represents/specifying



Comment at: docs/clang-tidy/checks/misc-move-constructor-init.rst:25-26
@@ +24,3 @@
+
+   When non-zero, the check is also used to implement
+   `cert-oop11-cpp `_. Default is `0`.

cert-oop11-cpp redirects to this file, so the link is a bit circular. Perhaps a 
better link is:

How about:
```
When non-zero, the check conforms to the behavior expected by the CERT secure 
coding recommendation `OOP11-CPP 
`_.
 Default is `0` for misc-move-constructor-init and `1` for cert-oop11-cpp
```


Comment at: docs/clang-tidy/checks/misc-sizeof-expression.rst:142
@@ +141,3 @@
+
+   When non-zero, the check will warn on expression like ``sizeof(CONSTANT)``.
+   Default is `1`.

s/on/on an


Comment at: docs/clang-tidy/checks/misc-sizeof-expression.rst:147
@@ +146,3 @@
+
+   When non-zero, the check will warn on expression like ``sizeof(this)``.
+   Default is `1`.

s/on/on an


Comment at: docs/clang-tidy/checks/misc-sizeof-expression.rst:152
@@ +151,3 @@
+
+   

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-30 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: aaron.ballman.
Eugene.Zelenko added a comment.

I don't have further comments, but as non-English speaker and mediocre writer, 
I would like see other people comments. May be @aaron.ballman could help if 
Alexander is busy?


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-30 Thread Haojian Wu via cfe-commits
hokein updated this revision to Diff 69679.
hokein marked an inline comment as done.
hokein added a comment.

- Use empty string words.
- rebase to master.


https://reviews.llvm.org/D23918

Files:
  docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-runtime-int.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-namespace-comment.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-sizeof-expression.rst
  docs/clang-tidy/checks/misc-string-constructor.rst
  docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  docs/clang-tidy/checks/modernize-pass-by-value.rst
  docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  docs/clang-tidy/checks/performance-for-range-copy.rst
  docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: docs/clang-tidy/checks/readability-implicit-bool-cast.rst
===
--- docs/clang-tidy/checks/readability-implicit-bool-cast.rst
+++ docs/clang-tidy/checks/readability-implicit-bool-cast.rst
@@ -116,3 +116,15 @@
 
 Occurrences of implicit casts inside macros and template instantiations are
 deliberately ignored, as it is not clear how to deal with such cases.
+
+Options
+---
+
+.. option::  AllowConditionalIntegerCasts
+
+   When non-zero, the check will allow conditional integer casts. Default is
+   `0`.
+
+.. option::  AllowConditionalPointerCasts
+
+   When non-zero, the check will allow conditional pointer casts. Default is `0`.
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -53,3 +53,11 @@
   void setValue(string Value) {
 Field = std::move(Value);
   }
+
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -5,15 +5,15 @@
 
 This check warns about the performance overhead arising from concatenating
 strings using the ``operator+``, for instance:
-
+
 .. code-block:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s
 (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code-block:: c++
 
std::string a("Foo"), b("Baz");
@@ -28,7 +28,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -49,3 +49,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- docs/clang-tidy/checks/performance-for-range-copy.rst
+++ docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,10 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, the check will warn on all auto copies. Default is `0`.
Index: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
===
--- docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
+++ docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
@@ -70,3 +70,10 @@
 
  // only 'f()' (or similar) will trigger the replacement.
 
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/modernize-pass-by-value.rst
===
--- docs/clang-tidy/checks/modernize-pass-by-value.rst
+++ docs/clang-tidy/checks/modernize-pass-by-value.rst
@@ -151,3 +151,11 @@
   For more information about the pass-by-value idiom, read: `Want Speed? Pass by Value`_.
 
   .. _Want 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-29 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added inline comments.


Comment at: docs/clang-tidy/checks/google-runtime-int.rst:27
@@ +26,2 @@
+
+   A string represents type suffix. Default is empty.

I think empty string will be better. Same for other occurrences.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-29 Thread Haojian Wu via cfe-commits
hokein updated this revision to Diff 69539.
hokein added a comment.

Remove extra blank line.


https://reviews.llvm.org/D23918

Files:
  docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index.rst
  docs/clang-tidy/checks/google-build-namespaces.rst
  docs/clang-tidy/checks/google-runtime-int.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/llvm-namespace-comment.rst
  docs/clang-tidy/checks/misc-definitions-in-headers.rst
  docs/clang-tidy/checks/misc-move-constructor-init.rst
  docs/clang-tidy/checks/misc-sizeof-expression.rst
  docs/clang-tidy/checks/misc-string-constructor.rst
  docs/clang-tidy/checks/misc-suspicious-missing-comma.rst
  docs/clang-tidy/checks/misc-suspicious-string-compare.rst
  docs/clang-tidy/checks/modernize-pass-by-value.rst
  docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
  docs/clang-tidy/checks/performance-for-range-copy.rst
  docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
  docs/clang-tidy/checks/performance-unnecessary-value-param.rst
  docs/clang-tidy/checks/readability-implicit-bool-cast.rst

Index: docs/clang-tidy/checks/readability-implicit-bool-cast.rst
===
--- docs/clang-tidy/checks/readability-implicit-bool-cast.rst
+++ docs/clang-tidy/checks/readability-implicit-bool-cast.rst
@@ -97,3 +97,15 @@
 
 Occurrences of implicit casts inside macros and template instantiations are
 deliberately ignored, as it is not clear how to deal with such cases.
+
+Options
+---
+
+.. option::  AllowConditionalIntegerCasts
+
+   When non-zero, the check will allow conditional integer casts. Default is
+   `0`.
+
+.. option::  AllowConditionalPointerCasts
+
+   When non-zero, the check will allow conditional pointer casts. Default is `0`.
Index: docs/clang-tidy/checks/performance-unnecessary-value-param.rst
===
--- docs/clang-tidy/checks/performance-unnecessary-value-param.rst
+++ docs/clang-tidy/checks/performance-unnecessary-value-param.rst
@@ -53,3 +53,11 @@
   void setValue(string Value) {
 Field = std::move(Value);
   }
+
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
===
--- docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
+++ docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst
@@ -4,14 +4,14 @@
 
 
 This check warns about the performance overhead arising from concatenating strings using the ``operator+``, for instance:
-
+
 .. code:: c++
 
 std::string a("Foo"), b("Bar");
 a = a + b;
 
 Instead of this structure you should use ``operator+=`` or ``std::string``'s (``std::basic_string``) class member function ``append()``. For instance:
-   
+
 .. code:: c++
 
std::string a("Foo"), b("Baz");
@@ -26,7 +26,7 @@
std::string a("Foo"), b("Baz");
for (int i = 0; i < 2; ++i) {
a.append("Bar").append(b);
-   } 
+   }
 
 And this can be rewritten too:
 
@@ -47,3 +47,11 @@
void g() {
f(std::string(a).append("Bar").append(b));
}
+
+Options
+---
+
+.. option:: StrictMode
+
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. Default is `0`.
Index: docs/clang-tidy/checks/performance-for-range-copy.rst
===
--- docs/clang-tidy/checks/performance-for-range-copy.rst
+++ docs/clang-tidy/checks/performance-for-range-copy.rst
@@ -17,3 +17,10 @@
 2. The loop variable is not const, but only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.
+
+Options
+---
+
+.. option:: WarnOnAllAutoCopies
+
+   When non-zero, the check will warn on all auto copies. Default is `0`.
Index: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
===
--- docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
+++ docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
@@ -70,3 +70,10 @@
 
  // only 'f()' (or similar) will trigger the replacement.
 
+Options
+---
+
+.. option:: IncludeStyle
+
+   A string represents which include-style is used, `llvm` or `google`. Default
+   is `llvm`.
Index: docs/clang-tidy/checks/modernize-pass-by-value.rst
===
--- docs/clang-tidy/checks/modernize-pass-by-value.rst
+++ docs/clang-tidy/checks/modernize-pass-by-value.rst
@@ -151,3 +151,11 @@
   For more information about the pass-by-value idiom, read: `Want Speed? Pass by Value`_.
 
   .. _Want Speed? Pass by Value: 

Re: [PATCH] D23918: [clang-tidy docs] Add missing option docs.

2016-08-26 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a comment.

General comments:

- I think //default is XYZ// is better then //XYZ by default//.

- There are discrepancies: option represent//ing// and option represent//s//.

I think will be good idea to involve native English speaker in review.



Comment at: docs/clang-tidy/checks/google-readability-namespace-comments.rst:11
@@ +10,3 @@
+
+Options
+---

This documentation is redirect, so options description should be moved to 
llvm-namespace-comment.rst.


Comment at: docs/clang-tidy/checks/google-readability-namespace-comments.rst:14
@@ +13,3 @@
+
+.. option:: ShortNamespaceLines;
+

Unnecessary semicolon at the end. Same below.


Comment at: docs/clang-tidy/checks/google-runtime-int.rst:27
@@ +26,2 @@
+
+   A string represents type suffix. `` by default.

Will empty string displayed? May be it should be expressed in words?


Comment at: docs/clang-tidy/checks/misc-move-constructor-init.rst:22
@@ +21,3 @@
+   by default.
+
+

Unnecessary empty line.


Comment at: docs/clang-tidy/checks/misc-move-constructor-init.rst:26
@@ +25,3 @@
+
+   When non-zero, the checker is also used to implement cert-oop11-cpp. `0` by
+   default.

s/checker/check/.  I think will be good idea to provide link to 
cert-oop11-cpp.rst.


Comment at: docs/clang-tidy/checks/misc-suspicious-missing-comma.rst:49
@@ +48,3 @@
+   An unsigned integer represents minimal size of a string literals array to be
+   considered by the checker. `5U` by default.
+

s/checker/check/


Comment at: docs/clang-tidy/checks/misc-suspicious-string-compare.rst:55
@@ +54,3 @@
+
+   A string represents the name of detecting string compare function. `` by
+   default.

Will empty string displayed? May be it should be expressed in words?


Comment at: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst:73
@@ -72,1 +72,3 @@
 
+
+Options

Unnecessary empty string.


Comment at: docs/clang-tidy/checks/modernize-replace-auto-ptr.rst:79
@@ +78,3 @@
+
+   A string specifying which include-style is used, `llvm` or `google`.
+   `llvm` by default.

`llvm` should be on this line. See other similar descriptions.


Comment at: 
docs/clang-tidy/checks/performance-inefficient-string-concatenation.rst:57
@@ +56,2 @@
+   When zero, the check will only check the string usage in ``while``, ``for``
+   and ``for-range`` statements. 0 by default.

Please highlight 0 with `.


Comment at: docs/clang-tidy/checks/readability-implicit-bool-cast.rst:106
@@ +105,3 @@
+
+   When non-zero, the check will allow conditional integer casts.
+   `0` by default.

Looks like `0` by should fit 80 characters. Same below.


https://reviews.llvm.org/D23918



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits