[clang-tools-extra] r346173 - [clang-tidy] doc removew hitespace in front of code-block-line

Jonas Toth via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 5 14:21:27 PST 2018


Author: jonastoth
Date: Mon Nov  5 14:21:27 2018
New Revision: 346173

URL: http://llvm.org/viewvc/llvm-project?rev=346173&view=rev
Log:
[clang-tidy] doc removew hitespace in front of code-block-line

Modified:
    clang-tools-extra/trunk/docs/clang-tidy/checks/boost-use-to-string.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-use-after-move.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-using-namespace.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/modernize-use-emplace.rst
    clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-transparent-functors.rst

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/boost-use-to-string.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/boost-use-to-string.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/boost-use-to-string.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/boost-use-to-string.rst Mon Nov  5 14:21:27 2018
@@ -11,7 +11,7 @@ It doesn't replace conversion from float
 overloads, because it would change the behaviour.
 
 
-  .. code-block:: c++
+.. code-block:: c++
 
     auto str = boost::lexical_cast<std::string>(42);
     auto wstr = boost::lexical_cast<std::wstring>(2137LL);

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst Mon Nov  5 14:21:27 2018
@@ -13,7 +13,7 @@ Item 26.
 
 Consider the following example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     class Person {
     public:

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst Mon Nov  5 14:21:27 2018
@@ -5,7 +5,7 @@ bugprone-move-forwarding-reference
 
 Warns if ``std::move`` is called on a forwarding reference, for example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     template <typename T>
     void foo(T&& t) {
@@ -22,7 +22,7 @@ function template argument.)
 
 In this example, the suggested fix would be
 
-  .. code-block:: c++
+.. code-block:: c++
 
     bar(std::forward<T>(t));
 
@@ -34,7 +34,7 @@ Code like the example above is sometimes
 deduced for ``T``, and that it is therefore not possible to pass an lvalue to
 ``foo()``. However, this is not true. Consider this example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     std::string s = "Hello, world";
     foo(s);

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst Mon Nov  5 14:21:27 2018
@@ -9,7 +9,7 @@ the code. More specifically, it looks fo
 context of the code (e.g. indentation) in an attempt to determine whether that
 is intentional.
 
-  .. code-block:: c++
+.. code-block:: c++
 
     if (x < y);
     {
@@ -20,7 +20,7 @@ Here the body of the ``if`` statement co
 of the first line, and `x` will be incremented regardless of the condition.
 
 
-  .. code-block:: c++
+.. code-block:: c++
 
     while ((line = readLine(file)) != NULL);
       processLine(line);
@@ -30,7 +30,7 @@ As a result of this code, `processLine()
 the code indicates the intention of the programmer.
 
 
-  .. code-block:: c++
+.. code-block:: c++
 
     if (x >= y);
     x -= y;
@@ -43,7 +43,7 @@ To solve the issue remove the stray semi
 intentional, reflect this using code indentation or put the semicolon in a new
 line. For example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     while (readWhitespace());
       Token t = readNextToken();
@@ -54,14 +54,14 @@ semicolon at the end of the first line.
 
 Either remove the indentation from the second line:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     while (readWhitespace());
     Token t = readNextToken();
 
 ... or move the semicolon from the end of the first line to a new line:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     while (readWhitespace())
       ;

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-use-after-move.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-use-after-move.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-use-after-move.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/bugprone-use-after-move.rst Mon Nov  5 14:21:27 2018
@@ -5,7 +5,7 @@ bugprone-use-after-move
 
 Warns if an object is used after it has been moved, for example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     std::string str = "Hello, world!\n";
     std::vector<std::string> messages;
@@ -18,7 +18,7 @@ moved.
 The check does not trigger a warning if the object is reinitialized after the
 move and before the use. For example, no warning will be output for this code:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     messages.emplace_back(std::move(str));
     str = "Greetings, stranger!\n";
@@ -28,7 +28,7 @@ The check takes control flow into accoun
 can be reached from the move. This means that the following code does not
 produce a warning:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     if (condition) {
       messages.emplace_back(std::move(str));
@@ -38,7 +38,7 @@ produce a warning:
 
 On the other hand, the following code does produce a warning:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     for (int i = 0; i < 10; ++i) {
       std::cout << str;
@@ -50,7 +50,7 @@ On the other hand, the following code do
 In some cases, the check may not be able to detect that two branches are
 mutually exclusive. For example (assuming that ``i`` is an int):
 
-  .. code-block:: c++
+.. code-block:: c++
 
     if (i == 1) {
       messages.emplace_back(std::move(str));
@@ -65,7 +65,7 @@ not possible for both the move and the u
 An erroneous warning can be silenced by reinitializing the object after the
 move:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     if (i == 1) {
       messages.emplace_back(std::move(str));
@@ -86,7 +86,7 @@ sub-expressions of a statement are evalu
 following, it is not guaranteed whether the use will happen before or after the
 move:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     void f(int i, std::vector<int> v);
     std::vector<int> v = { 1, 2, 3 };
@@ -124,7 +124,7 @@ that consumes this parameter does not mo
 conditionally. For example, in the following situation, the check will assume
 that a move always takes place:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     std::vector<std::string> messages;
     void f(std::string &&str) {
@@ -186,7 +186,7 @@ that struct is written to, the check doe
 reinitialization -- even if, eventually, all member variables of the struct are
 written to. For example:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     struct S {
       std::string str;

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst Mon Nov  5 14:21:27 2018
@@ -28,7 +28,7 @@ Options
    When set to `1` (default is `0`), this check doesn't flag classes with a sole, explicitly
    defaulted destructor. An example for such a class is:
    
-   .. code-block:: c++
+.. code-block:: c++
    
      struct A {
        virtual ~A() = default;
@@ -40,7 +40,7 @@ Options
    operations at all. It still flags classes which define only one of either
    move constructor or move assignment operator. With this option enabled, the following class won't be flagged:
    
-   .. code-block:: c++
+.. code-block:: c++
    
      struct A {
        A(const A&);

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-using-namespace.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-using-namespace.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-using-namespace.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/google-build-using-namespace.rst Mon Nov  5 14:21:27 2018
@@ -11,7 +11,7 @@ The check implements the following rule
   You may not use a using-directive to make all names from a namespace
   available.
 
-  .. code-block:: c++
+.. code-block:: c++
 
     // Forbidden -- This pollutes the namespace.
     using namespace foo;

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-pass-by-value.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-pass-by-value.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-pass-by-value.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-pass-by-value.rst Mon Nov  5 14:21:27 2018
@@ -13,7 +13,7 @@ The transformation is usually beneficial
 *rvalue* and assumes the move construction is a cheap operation. This short
 example illustrates how the construction of the value happens:
 
-  .. code-block:: c++
+.. code-block:: c++
 
     void foo(std::string s);
     std::string get_str();
@@ -39,7 +39,7 @@ Since ``std::move()`` is a library funct
 necessary to add this include. The check will add the include directive when
 necessary.
 
-  .. code-block:: c++
+.. code-block:: c++
 
      #include <string>
 

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst Mon Nov  5 14:21:27 2018
@@ -46,7 +46,7 @@ Known Limitations
   sense and usually ``std::auto_ptr`` are stored by value (otherwise what is
   the point in using them instead of a reference or a pointer?).
 
-  .. code-block:: c++
+.. code-block:: c++
 
      // <3rd-party header...>
      std::auto_ptr<int> get_value();
@@ -61,7 +61,7 @@ Known Limitations
 
 * Non-instantiated templates aren't modified.
 
-  .. code-block:: c++
+.. code-block:: c++
 
      template <typename X>
      void f() {

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst Mon Nov  5 14:21:27 2018
@@ -107,7 +107,7 @@ Options
     When non-zero, the check will ignore implicitly constructed arguments of
     ``push_back``, e.g.
 
-    .. code-block:: c++
+.. code-block:: c++
 
         std::vector<std::string> v;
         v.push_back("a"); // Ignored when IgnoreImplicitConstructors is ``1``.

Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-transparent-functors.rst
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-transparent-functors.rst?rev=346173&r1=346172&r2=346173&view=diff
==============================================================================
--- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-transparent-functors.rst (original)
+++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-transparent-functors.rst Mon Nov  5 14:21:27 2018
@@ -8,7 +8,7 @@ functors, the type does not need to be r
 maintain and less prone to errors. It is not possible to introduce unwanted
 conversions.
 
-  .. code-block:: c++
+.. code-block:: c++
 
     // Non-transparent functor
     std::map<int, std::string, std::greater<int>> s;
@@ -22,7 +22,7 @@ conversions.
 It is not always a safe transformation though. The following case will be
 untouched to preserve the semantics.
 
-  .. code-block:: c++
+.. code-block:: c++
 
     // Non-transparent functor
     std::map<const char *, std::string, std::greater<std::string>> s;




More information about the cfe-commits mailing list