diff --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst --- a/clang-tools-extra/docs/clang-tidy/Contributing.rst +++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -475,7 +475,7 @@ .. code-block:: console - $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp + $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp $ # Note that there won't be timings table printed to the console. $ ls /tmp/out/ 20180516161318717446360-source.cpp.json diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst @@ -27,5 +27,5 @@ Note: In the second example, the suggested fix could yield a different result, -as the conversion to integer could truncate. In practice, this is very rare, +as the conversion to integer could truncate. In practice, this is very rare, and you should use ``absl::Trunc`` to perform this operation explicitly instead. diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst @@ -10,7 +10,7 @@ ``find()`` and ``npos`` from different string-like types. By default, "string-like types" includes ``::std::basic_string``, -``::std::basic_string_view``, and ``::absl::string_view``. See the +``::std::basic_string_view``, and ``::absl::string_view``. See the StringLikeClasses option to change this. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst --- a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst @@ -4,7 +4,7 @@ ==================== A common source of security bugs is code that opens a file without using the -``O_CLOEXEC`` flag. Without that flag, an opened sensitive file would remain +``O_CLOEXEC`` flag. Without that flag, an opened sensitive file would remain open across a fork+exec to a lower-privileged SELinux domain, leaking that sensitive data. Open-like functions including ``open()``, ``openat()``, and ``open64()`` should include ``O_CLOEXEC`` in their flags argument. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst @@ -9,7 +9,7 @@ allocation function (``malloc()``, ``calloc()``, ``realloc()``, ``alloca()``) or the ``new[]`` operator in `C++`. The check detects error cases even if one of these functions (except the ``new[]`` operator) is called by a constant function -pointer. Cases where ``1`` is added both to the parameter and the result of the +pointer. Cases where ``1`` is added both to the parameter and the result of the ``strlen()``-like function are ignored, as are cases where the whole addition is surrounded by extra parentheses. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst @@ -162,7 +162,7 @@ The check handles ``static_cast``, ``dynamic_cast``, ``const_cast``, ``reinterpret_cast``, functional casts, C-style casts and function templates that behave as casts, such as ``llvm::dyn_cast``, ``boost::lexical_cast`` and -``gsl::narrow_cast``. Calls to function templates are considered to behave as +``gsl::narrow_cast``. Calls to function templates are considered to behave as casts if the first template argument is explicit and is a type, and the function returns that type, or a pointer or reference to it. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst @@ -4,7 +4,7 @@ ====================== This check replaces deprecated dynamic exception specifications with -the appropriate noexcept specification (introduced in C++11). By +the appropriate noexcept specification (introduced in C++11). By default this check will replace ``throw()`` with ``noexcept``, and ``throw([,...])`` or ``throw(...)`` with ``noexcept(false)``. @@ -30,9 +30,9 @@ .. option:: ReplacementString Users can use :option:`ReplacementString` to specify a macro to use - instead of ``noexcept``. This is useful when maintaining source code + instead of ``noexcept``. This is useful when maintaining source code that uses custom exception specification marking other than - ``noexcept``. Fix-it hints will only be generated for non-throwing + ``noexcept``. Fix-it hints will only be generated for non-throwing specifications. Example diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst @@ -5,7 +5,7 @@ Checks for functions with a ``const``-qualified return type and recommends removal of the ``const`` keyword. Such use of `const` is usually superfluous, -and can prevent valuable compiler optimizations. Does not (yet) fix trailing +and can prevent valuable compiler optimizations. Does not (yet) fix trailing return types. Examples: diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst @@ -4,8 +4,8 @@ ======================== Finds cases where code could use ``data()`` rather than the address of the -element at index 0 in a container. This pattern is commonly used to materialize -a pointer to the backing data of a container. ``std::vector`` and +element at index 0 in a container. This pattern is commonly used to materialize +a pointer to the backing data of a container. ``std::vector`` and ``std::string`` provide a ``data()`` accessor to retrieve the data pointer which should be preferred. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst @@ -109,7 +109,7 @@ .. option:: IgnoredExceptionVariableNames Specifies a regular expression for exception variable names that are to - be ignored. The default value is `^[e]$` mainly for historical reasons. + be ignored. The default value is `^[e]$` mainly for historical reasons. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst @@ -65,7 +65,7 @@ auto *Foo2 = cast(Bar2); auto &Foo3 = cast(Bar3); -If AddConstToQualified is set to `false`, it will be transformed into: +If AddConstToQualified is set to `false`, it will be transformed into: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -281,10 +281,10 @@ ================================= :program:`clang-tidy` diagnostics are intended to call out code that does not -adhere to a coding standard, or is otherwise problematic in some way. However, +adhere to a coding standard, or is otherwise problematic in some way. However, if the code is known to be correct, it may be useful to silence the warning. Some clang-tidy checks provide a check-specific way to silence the diagnostics, -e.g. `bugprone-use-after-move `_ can be +e.g. `bugprone-use-after-move `_ can be silenced by re-initializing the variable after it has been moved out, `bugprone-string-integer-assignment `_ can be suppressed by