no bug - coding style C++ doc: fix the note syntax r=sg
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 30 Jan 2020 08:00:21 +0000
changeset 512090 94d79e1b849ef7b7c33be1f9bd57e904d9433d6a
parent 512089 cb607bf4c55f687bfbf3e298dc4073ddcd10a945
child 512091 f567747993a768266230a07deec085c690e8fa37
push id37072
push usercsabou@mozilla.com
push dateThu, 30 Jan 2020 15:44:43 +0000
treeherdermozilla-central@f97c48da9cee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssg
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
no bug - coding style C++ doc: fix the note syntax r=sg Differential Revision: https://phabricator.services.mozilla.com/D61246
tools/lint/docs/coding-style/coding_style_cpp.rst
--- a/tools/lint/docs/coding-style/coding_style_cpp.rst
+++ b/tools/lint/docs/coding-style/coding_style_cpp.rst
@@ -94,17 +94,18 @@ Examples:
        break;
      default:
        break;
    }
 
 ``else`` should only ever be followed by ``{`` or ``if``; i.e., other
 control keywords are not allowed and should be placed inside braces.
 
-.. note:
+.. note::
+
    For this rule, clang-tidy provides the ``google-readability-braces-around-statements``
    check with autofixes.
 
 
 C++ namespaces
 ~~~~~~~~~~~~~~
 
 Mozilla project C++ declarations should be in the ``mozilla``
@@ -115,17 +116,18 @@ probability of colliding with other name
 module-specific namespaces, under ``mozilla``, with short
 all-lowercase names. Other global namespaces besides ``mozilla`` are
 not allowed.
 
 No ``using`` directives are allowed in header files, except inside class
 definitions or functions. (We don't want to pollute the global scope of
 compilation units that use the header file.)
 
-.. note:
+.. note::
+
    For parts of this rule, clang-tidy provides the ``google-global-names-in-headers``
    check. It only detects ``using namespace`` directives in the global namespace.
 
 
 ``using namespace ...;`` is only allowed in ``.cpp`` files after all
 ``#include``\ s. Prefer to wrap code in ``namespace ... { ... };``
 instead, if possible. ``using namespace ...;``\ should always specify
 the fully qualified namespace. That is, to use ``Foo::Bar`` do not
@@ -195,17 +197,18 @@ C++ classes
    private:
      int mVar;
    };
 
    } // namespace mozilla
 
 Define classes using the style given above.
 
-.. note:
+.. note::
+
    For the rule on ``= default``, clang-tidy provides the ``modernize-use-default``
    check with autofixes.
 
    For the rule on explicit constructors and conversion operators, clang-tidy
    provides the ``mozilla-implicit-constructor`` check.
 
 Existing classes in the global namespace are named with a short prefix
 (For example, ``ns``) as a pseudo-namespace.
@@ -238,17 +241,18 @@ virtual methods, which do not override a
 signature. Use ``override`` to declare virtual methods which do
 override a base class method, with the same signature, but can be
 further overridden in derived classes. Use ``final`` to declare virtual
 methods which do override a base class method, with the same signature,
 but can NOT be further overridden in the derived classes. This should
 help the person reading the code fully understand what the declaration
 is doing, without needing to further examine base classes.
 
-.. note:
+.. note::
+
    For the rule on ``virtual/override/final``, clang-tidy provides the
    ``modernize-use-override`` check with autofixes.
 
 
 Operators
 ~~~~~~~~~
 
 The unary keyword operator ``sizeof``, should have its operand parenthesized
@@ -309,31 +313,33 @@ C/C++ practices
 ---------------
 
 -  **Have you checked for compiler warnings?** Warnings often point to
    real bugs. `Many of them <https://searchfox.org/mozilla-central/source/build/moz.configure/warnings.configure>`__
    are enabled by default in the build system.
 -  In C++ code, use ``nullptr`` for pointers. In C code, using ``NULL``
    or ``0`` is allowed.
 
-.. note:
+.. note::
+
    For the C++ rule, clang-tidy provides the ``modernize-use-nullptr`` check
    with autofixes.
 
 -  Don't use ``PRBool`` and ``PRPackedBool`` in C++, use ``bool``
    instead.
 -  For checking if a ``std`` container has no items, don't use
    ``size()``, instead use ``empty()``.
 -  When testing a pointer, use ``(!myPtr)`` or ``(myPtr)``;
    don't use ``myPtr != nullptr`` or ``myPtr == nullptr``.
 -  Do not compare ``x == true`` or ``x == false``. Use ``(x)`` or
    ``(!x)`` instead. ``if (x == true)`` may have semantics different from
    ``if (x)``!
 
-.. note:
+.. note::
+
    clang-tidy provides the ``readability-simplify-boolean-expr`` check
    with autofixes that checks for these and some other boolean expressions
    that can be simplified.
 
 -  In general, initialize variables with ``nsFoo aFoo = bFoo,`` and not
    ``nsFoo aFoo(bFoo)``.
 
    -  For constructors, initialize member variables with : ``nsFoo