Author: Salman Javed Date: 2021-10-23T00:07:36-07:00 New Revision: 5de69e16ea9ab916401f4a8390fff91f18bbba2a
URL: https://github.com/llvm/llvm-project/commit/5de69e16ea9ab916401f4a8390fff91f18bbba2a DIFF: https://github.com/llvm/llvm-project/commit/5de69e16ea9ab916401f4a8390fff91f18bbba2a.diff LOG: [clang-tidy] Tidy up spelling, grammar, and inconsistencies in documentation (NFC) Differential Revision: https://reviews.llvm.org/D112356 Added: Modified: clang-tools-extra/docs/clang-tidy/Contributing.rst clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst clang-tools-extra/docs/clang-tidy/index.rst Removed: ################################################################################ diff --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst index a9a9caf76ac60..7ebfac3123603 100644 --- a/clang-tools-extra/docs/clang-tidy/Contributing.rst +++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -131,8 +131,8 @@ are located in subdirectories of `clang-tidy/ <https://github.com/llvm/llvm-project/tree/main/clang-tools-extra/clang-tidy/>`_ and contain checks targeting a certain aspect of code quality (performance, readability, etc.), certain coding style or standard (Google, LLVM, CERT, etc.) -or a widely used API (e.g. MPI). Their names are same as user-facing check -groups names described :ref:`above <checks-groups-table>`. +or a widely used API (e.g. MPI). Their names are the same as the user-facing +check group names described :ref:`above <checks-groups-table>`. After choosing the module and the name for the check, run the ``clang-tidy/add_new_check.py`` script to create the skeleton of the check and @@ -441,8 +441,8 @@ warnings and errors. The script provides multiple configuration flags. * To restrict the files examined you can provide one or more regex arguments that the file names are matched against. ``run-clang-tidy.py clang-tidy/.*Check\.cpp`` will only analyze clang-tidy - checks. It may also be necessary to restrict the header files warnings are - displayed from using the ``-header-filter`` flag. It has the same behavior + checks. It may also be necessary to restrict the header files that warnings + are displayed from using the ``-header-filter`` flag. It has the same behavior as the corresponding :program:`clang-tidy` flag. * To apply suggested fixes ``-fix`` can be passed as an argument. This gathers @@ -475,7 +475,7 @@ It can also store that data as JSON files for further processing. Example output .. 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 index 3c1a152be8213..05c11cddfd5f9 100644 --- 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 @@ Examples: Note: In the second example, the suggested fix could yield a diff erent 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-no-internal-dependencies.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst index 1032cc3db5fae..3ddb023db8baf 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst @@ -5,7 +5,7 @@ abseil-no-internal-dependencies Warns if code using Abseil depends on internal details. If something is in a namespace that includes the word "internal", code is not allowed to depend upon -it because it’s an implementation detail. They cannot friend it, include it, +it because it's an implementation detail. They cannot friend it, include it, you mention it or refer to it in any way. Doing so violates Abseil's compatibility guidelines and may result in breakage. See https://abseil.io/about/compatibility for more information. 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 index 4cf99d5877a95..042fbdb3f29a9 100644 --- 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 @@ This improves readability and reduces the likelihood of accidentally mixing ``find()`` and ``npos`` from diff erent 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 index ee3e4b5b41296..850eae7023c64 100644 --- 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 @@ android-cloexec-open ==================== 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/android-cloexec-pipe2.rst b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst index 071d7d8b06c39..9fb54bee0d571 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst @@ -3,7 +3,7 @@ android-cloexec-pipe2 ===================== -This checks ensures that pipe2() is called with the O_CLOEXEC flag. The check also +This check ensures that pipe2() is called with the O_CLOEXEC flag. The check also adds the O_CLOEXEC flag that marks the file descriptor to be closed in child processes. Without this flag a sensitive file descriptor can be leaked to a child process, potentially into a lower-privileged SELinux domain. diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst index 929616630cbc1..8365e80fb95a3 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst @@ -8,7 +8,7 @@ This check finds conversion from integer type like ``int`` to ``std::string`` or ``std::to_string`` and ``std::to_wstring``. It doesn't replace conversion from floating points despite the ``to_string`` -overloads, because it would change the behaviour. +overloads, because it would change the behavior. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst index 18a7d4ef3dbf4..9097688c46774 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst @@ -87,4 +87,4 @@ Unlike if statements, the check does not detect chains of conditional operators. Note: This check also reports situations where branches become identical only -after preprocession. +after preprocessing. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst index 5ea635766e5bc..dad4205858a8e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst @@ -116,7 +116,7 @@ noisiness. The value is a `;`-separated list of names. To ignore unnamed parameters, add `""` to the list verbatim (not the empty string, but the two quotes, potentially escaped!). - **This options is case-sensitive!** + **This option is case-sensitive!** By default, the following parameter names, and their Uppercase-initial variants are ignored: @@ -154,7 +154,7 @@ noisiness. ``a < b``. * The parameters are further passed to the same function to the same parameter of that function, of the same overload. - E.g. ``f(a, 1)`` and ``f(b, 2)`` to some ``f(T, int)``. + e.g. ``f(a, 1)`` and ``f(b, 2)`` to some ``f(T, int)``. .. note:: @@ -202,7 +202,7 @@ an argument list, and C++ template instantiations. Most of these cases, which are otherwise swappable from a caller's standpoint, have no way of getting "fixed" at the definition point. In the case of C++ templates, only primary template definitions and explicit -specialisations are matched and analysed. +specializations are matched and analyzed. None of the following cases produce a diagnostic: @@ -241,7 +241,7 @@ not diagnosed. void exact(typename Vector<T>::element_type A, typename Vector<T>::element_type B) { /* ... */ } - // Skipped: The two parameters are both 'T' but we can not prove this + // Skipped: The two parameters are both 'T' but we cannot prove this // without actually instantiating. template <typename T> void falseNegative(T A, typename Vector<T>::element_type B) { /* ... */ } diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst index 5386fdba9e7fe..c4ddd02602b73 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst @@ -8,7 +8,7 @@ widened, and suggests (with fix-it) to either silence the code by making widening explicit, or to perform the multiplication in a wider type, to avoid the widening afterwards. -This is mainly useful when operating on a very large buffers. +This is mainly useful when operating on very large buffers. For example, consider: .. code-block:: c++ @@ -22,7 +22,7 @@ For example, consider: } } -This is fine in general, but iff ``width * height`` overflows, +This is fine in general, but if ``width * height`` overflows, you end up wrapping back to the beginning of ``base`` instead of processing the entire requested buffer. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst index f8270801cb2f5..b6bafcec1644f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst @@ -4,10 +4,10 @@ bugprone-macro-parentheses ========================== -Finds macros that can have unexpected behaviour due to missing parentheses. +Finds macros that can have unexpected behavior due to missing parentheses. Macros are expanded by the preprocessor as-is. As a result, there can be -unexpected behaviour; operators may be evaluated in unexpected order and +unexpected behavior; operators may be evaluated in unexpected order and unary operators may become binary operators, etc. When the replacement list has an expression, it is recommended to surround 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 index e6ff2fe10c1ca..38df4803b45f3 100644 --- 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 @@ instead of the result and the value is used as an argument to a memory 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/bugprone-not-null-terminated-result.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst index 10a6eb35ae444..9934807861464 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst @@ -6,7 +6,7 @@ bugprone-not-null-terminated-result Finds function calls where it is possible to cause a not null-terminated result. Usually the proper length of a string is ``strlen(src) + 1`` or equal length of this expression, because the null terminator needs an extra space. Without the -null terminator it can result in undefined behaviour when the string is read. +null terminator it can result in undefined behavior when the string is read. The following and their respective ``wchar_t`` based functions are checked: @@ -61,7 +61,7 @@ Rewrite based on the destination array obtain the capacity of the destination array then the new function could be the safe version (ending with ``cpy_s``). -- If the new function is could be safe version and C++ files are analysed and +- If the new function is could be safe version and C++ files are analyzed and the destination array is plain ``char``/``wchar_t`` without ``un/signed`` then the length of the destination array can be omitted. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst index 74ceb71937cfc..4ba7c3008bd6a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst @@ -185,5 +185,5 @@ Options .. option:: WarnOnSizeOfCompareToConstant When `true`, the check will warn on an expression like - ``sizeof(epxr) <= k`` for a suspicious constant `k` while `k` is `0` or + ``sizeof(expr) <= k`` for a suspicious constant `k` while `k` is `0` or greater than `0x8000`. Default is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst index 54797d7ab87ee..85e17967728bd 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst @@ -14,7 +14,7 @@ Checks for calls with implicit comparator and proposed to explicitly add it. if (!strcmp(...)) // Won't warn if (strcmp(...) != 0) // Won't warn -Checks that compare function results (i,e, ``strcmp``) are compared to valid +Checks that compare function results (i.e., ``strcmp``) are compared to valid constant. The resulting value is .. code:: diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst index 1381adc5493ca..0f45cc2fe1146 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst @@ -25,7 +25,7 @@ In a real use case size means a container's size which depends on the user input for (short i = 0; i < items.size(); ++i) {} } -This algorithm works for small amount of objects, but will lead to freeze for a +This algorithm works for a small amount of objects, but will lead to freeze for a larger user input. .. option:: MagnitudeBitsUpperLimit diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst index 764ef7a476bde..63747ec7602e2 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst @@ -21,5 +21,5 @@ is allowed to propagate out of the function (exception handler is checked for types ``std::bad_alloc``, ``std::exception``, and catch-all handler). The check assumes that any user-defined ``operator new`` is either ``noexcept`` or may throw an exception of type ``std::bad_alloc`` (or derived -from it). Other exception types or exceptions occurring in the objects's +from it). Other exception types or exceptions occurring in the object's constructor are not taken into account. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst index 38ff2d0369937..b3f02b839c4a4 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst @@ -3,7 +3,7 @@ bugprone-virtual-near-miss ========================== -Warn if a function is a near miss (ie. the name is very similar and the function +Warn if a function is a near miss (i.e. the name is very similar and the function signature is the same) to a virtual function from a base class. Example: diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst index 818ae8fea71c2..2b19172f1736c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst @@ -21,4 +21,4 @@ This check corresponds to the CERT C++ Coding Standard recommendation DCL21-CPP. Overloaded postfix increment and decrement operators should return a const object. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires -an account on their wiki to view. \ No newline at end of file +an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst index 8f5220b425adb..d96f6a71621bd 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst @@ -12,4 +12,4 @@ for more information. This check corresponds to the CERT C++ Coding Standard recommendation ERR09-CPP. Throw anonymous temporaries. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior -of this check requires an account on their wiki to view. \ No newline at end of file +of this check requires an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst index df06f75000fa0..c3649b199e848 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst @@ -13,4 +13,4 @@ This check corresponds to the CERT C++ Coding Standard recommendation OOP11-CPP. Do not copy-initialize members or base classes from a move constructor. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires -an account on their wiki to view. \ No newline at end of file +an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst b/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst index 4e46ba1edc34f..67d8f99ab45bb 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst @@ -12,7 +12,7 @@ Note that using some thread-unsafe functions may be still valid in concurrent programming if only a single thread is used (e.g. setenv(3)), however, some functions may track a state in global variables which would be clobbered by subsequent (non-parallel, but concurrent) calls to -a related function. E.g. the following code suffers from unprotected +a related function. e.g. the following code suffers from unprotected accesses to a global state: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst index 91cf4aa0f0bb1..c03046702fccc 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst @@ -4,7 +4,7 @@ cppcoreguidelines-init-variables ================================ Checks whether there are local variables that are declared without an initial -value. These may lead to unexpected behaviour if there is a code path that reads +value. These may lead to unexpected behavior if there is a code path that reads the variable before assigning to it. Only integers, booleans, floats, doubles and pointers are checked. The fix diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst index 4085bce4fc298..e750c76676c5a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst @@ -84,7 +84,7 @@ the range [-2^31, 2^31-1]. You may have encountered messages like "narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined". -The C/C++ standard does not mandate two’s complement for signed integers, and so +The C/C++ standard does not mandate two's complement for signed integers, and so the compiler is free to define what the semantics are for converting an unsigned -integer to signed integer. Clang's implementation uses the two’s complement +integer to signed integer. Clang's implementation uses the two's complement format. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst index 7eb8d1422ea7a..c75bf8cbe24d9 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst @@ -51,7 +51,7 @@ Options .. option:: AllowMissingMoveFunctionsWhenCopyIsDeleted When set to `true` (default is `false`), this check doesn't flag classes which define deleted copy - operations but don't define move operations. This flags is related to Google C++ Style Guide + operations but don't define move operations. This flag is related to Google C++ Style Guide https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types. With this option enabled, the following class won't be flagged: diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst index 48a04e54300c7..ae12d563a48fc 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst @@ -5,7 +5,7 @@ cppcoreguidelines-virtual-class-destructor Finds virtual classes whose destructor is neither public and virtual nor protected and non-virtual. A virtual class's destructor should be specified -in one of these ways to prevent undefined behaviour. +in one of these ways to prevent undefined behavior. This check implements `C.35 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-dtor-virtual>`_ diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst index 2ceaa96ec4a7f..3c18c753248da 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst @@ -68,7 +68,7 @@ Degenerated ``switch`` statements without any labels are caught as well. int i = 42; switch(i) { case 1: // do something here - default: // do somethe else here + default: // do something else here } // Should rather be the following: diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst index 4c6bc005a8ec4..4d341df1c799d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst @@ -4,7 +4,7 @@ hicpp-signed-bitwise ==================== Finds uses of bitwise operations on signed integer types, which may lead to -undefined or implementation defined behaviour. +undefined or implementation defined behavior. The according rule is defined in the `High Integrity C++ Standard, Section 5.6.1 <http://www.codingstandard.com/section/5-6-shift-operators/>`_. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst index cf0cc2d130d7f..560d43f8d6216 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst @@ -5,7 +5,7 @@ misc-static-assert `cert-dcl03-c` redirects here as an alias for this check. -Replaces ``assert()`` with ``static_assert()`` if the condition is evaluatable +Replaces ``assert()`` with ``static_assert()`` if the condition is evaluable at compile time. The condition of ``static_assert()`` is evaluated at compile time which is diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst index b8776b272f9d7..847e738fa7610 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst @@ -14,7 +14,8 @@ the CERT C++ Coding Standard rule `ERR61-CPP. Catch exceptions by lvalue referen Exceptions: * Throwing string literals will not be flagged despite being a pointer. They - are not susceptible to slicing and the usage of string literals is idomatic. + are not susceptible to slicing and the usage of string literals is + idiomatic. * Catching character pointers (``char``, ``wchar_t``, unicode character types) will not be flagged to allow catching sting literals. * Moved named values will not be flagged as not throwing an anonymous @@ -22,7 +23,7 @@ Exceptions: can't be accessed outside catch blocks handling the error. * Throwing function parameters will not be flagged as not throwing an anonymous temporary. This allows helper functions for throwing. - * Re-throwing caught exception variables will not be flragged as not throwing + * Re-throwing caught exception variables will not be flagged as not throwing an anonymous temporary. Although this can usually be done by just writing ``throw;`` it happens often enough in real code. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst index 9c8df6a7c8411..9cf1f6e68d0a1 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst @@ -72,7 +72,7 @@ simply ignored. Without ``PermissiveParameterList``, this would be transformed i return ignore_args(3, 3); } -which will *not* compile, since the lambda does not contain an ``operator()`` that +which will *not* compile, since the lambda does not contain an ``operator()`` that accepts 2 arguments. With permissive parameter list, it instead generates .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst index d7bc7474e27f8..bc61033ff1fa1 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst @@ -56,5 +56,5 @@ such headers between C code, and C++ code. } Similarly, the ``main()`` function is ignored. Its second and third parameters -can be either ``char* argv[]`` or ``char** argv``, but can not be +can be either ``char* argv[]`` or ``char** argv``, but cannot be ``std::array<>``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst index 77f251831627a..5408c6467b132 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst @@ -138,7 +138,7 @@ lives. Specify the function used to reverse an iterator pair, the function should accept a class with ``rbegin`` and ``rend`` methods and return a - class with ``begin`` and ``end`` methods methods that call the ``rbegin`` and + class with ``begin`` and ``end`` methods that call the ``rbegin`` and ``rend`` methods respectively. Common examples are ``ranges::reverse_view`` and ``llvm::reverse``. Default value is an empty string. @@ -165,7 +165,7 @@ Limitations There are certain situations where the tool may erroneously perform transformations that remove information and change semantics. Users of the tool -should be aware of the behaviour and limitations of the check outlined by +should be aware of the behavior and limitations of the check outlined by the cases below. Comments inside loop headers @@ -300,7 +300,7 @@ OpenMP ^^^^^^ As range-based for loops are only available since OpenMP 5, this check should -not been used on code with a compatibility requirements of OpenMP prior to +not be used on code with a compatibility requirement of OpenMP prior to version 5. It is **intentional** that this check does not make any attempts to exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst index a93bfeaa9d0ce..e884cf3c4f5df 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst @@ -124,7 +124,7 @@ When delayed template parsing is enabled, constructors part of templated contexts; templated constructors, constructors in class templates, constructors of inner classes of template classes, etc., are not transformed. Delayed template parsing is enabled by default on Windows as a Microsoft extension: -`Clang Compiler User’s Manual - Microsoft extensions`_. +`Clang Compiler User's Manual - Microsoft extensions`_. Delayed template parsing can be enabled using the `-fdelayed-template-parsing` flag and disabled using `-fno-delayed-template-parsing`. @@ -144,7 +144,7 @@ Example: + C(std::string S) : S(std::move(S)) {} }; -.. _Clang Compiler User’s Manual - Microsoft extensions: https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions +.. _Clang Compiler User's Manual - Microsoft extensions: https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions .. seealso:: diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst index c1c8ace0c937d..3bca4ecd03e40 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst @@ -7,7 +7,7 @@ Finds macro expansions of ``DISALLOW_COPY_AND_ASSIGN(Type)`` and replaces them with a deleted copy constructor and a deleted assignment operator. Before the ``delete`` keyword was introduced in C++11 it was common practice to -declare a copy constructor and an assignment operator as a private members. This +declare a copy constructor and an assignment operator as private members. This effectively makes them unusable to the public API of a class. With the advent of the ``delete`` keyword in C++11 we can abandon the 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 index f7333fc5739a4..3aa5c6b07b25c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst @@ -57,7 +57,7 @@ improving readability and maintainability. The check will only replace iterator type-specifiers when all of the following conditions are satisfied: -* The iterator is for one of the standard container in ``std`` namespace: +* The iterator is for one of the standard containers in ``std`` namespace: * ``array`` * ``deque`` @@ -115,7 +115,7 @@ New expressions Frequently, when a pointer is declared and initialized with ``new``, the pointee type is written twice: in the declaration type and in the -``new`` expression. In this cases, the declaration type can be replaced with +``new`` expression. In this case, the declaration type can be replaced with ``auto`` improving readability and maintainability. .. code-block:: c++ @@ -148,7 +148,7 @@ Cast expressions Frequently, when a variable is declared and initialized with a cast, the variable type is written twice: in the declaration type and in the -cast expression. In this cases, the declaration type can be replaced with +cast expression. In this case, the declaration type can be replaced with ``auto`` improving readability and maintainability. .. code-block:: c++ @@ -162,7 +162,7 @@ cast expression. In this cases, the declaration type can be replaced with 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-default-member-init.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst index fd6c02269f513..a77415301ef6a 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst @@ -36,7 +36,7 @@ Options .. option:: UseAssignment - If this option is set to `true` (default is `false`), the check will initialise + If this option is set to `true` (default is `false`), the check will initialize members with an assignment. For example: .. code-block:: c++ 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 index eb6f005fc91b7..4ea8ee0d7a297 100644 --- 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 @@ modernize-use-noexcept ====================== 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(<exception>[,...])`` or ``throw(...)`` with ``noexcept(false)``. @@ -30,9 +30,9 @@ Options .. 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/modernize-use-nullptr.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst index e65b65b032bf7..ffb1cb78dffe0 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst @@ -3,7 +3,7 @@ modernize-use-nullptr ===================== -The check converts the usage of null pointer constants (eg. ``NULL``, ``0``) +The check converts the usage of null pointer constants (e.g. ``NULL``, ``0``) to use the new C++11 ``nullptr`` keyword. Example diff --git a/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst b/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst index ae1cc67bdee76..b980270222cef 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst @@ -7,7 +7,7 @@ Finds calls to ``NSInvocation`` methods under ARC that don't have proper argument object lifetimes. When passing Objective-C objects as parameters to the ``NSInvocation`` methods ``getArgument:atIndex:`` and ``getReturnValue:``, the values are copied by value into the argument pointer, -which leads to to incorrect releasing behavior if the object pointers are +which leads to incorrect releasing behavior if the object pointers are not declared ``__unsafe_unretained``. For code: diff --git a/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst b/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst index d85e4fd52462d..07e5c3cbc15ef 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst @@ -8,9 +8,9 @@ out of the Structured Block it was thrown in. As per the OpenMP specification, a structured block is an executable statement, possibly compound, with a single entry at the top and a single exit at the -bottom. Which means, ``throw`` may not be used to to 'exit' out of the +bottom. Which means, ``throw`` may not be used to 'exit' out of the structured block. If an exception is not caught in the same structured block -it was thrown in, the behaviour is undefined. +it was thrown in, the behavior is undefined. FIXME: this check does not model SEH, ``setjmp``/``longjmp``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst b/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst index 77114100ba1cb..85d73e8147c00 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst @@ -18,7 +18,7 @@ Example .. code-block:: c++ - // ``for`` directive can not have ``default`` clause, no diagnostics. + // ``for`` directive cannot have ``default`` clause, no diagnostics. void n0(const int a) { #pragma omp for for (int b = 0; b < a; b++) diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst b/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst index fe7195b440f9f..062c62c3aa24f 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst @@ -6,7 +6,7 @@ performance-inefficient-algorithm Warns on inefficient use of STL algorithms on associative containers. -Associative containers implements some of the algorithms as methods which +Associative containers implement some of the algorithms as methods which should be preferred to the algorithms in the algorithm header. The methods can take advantage of the order of the elements. 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 index 6242e43818d48..154131b603511 100644 --- 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 @@ readability-const-return-type 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 index 46febd26496d6..4855e4b42b435 100644 --- 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 @@ readability-data-pointer ======================== 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-else-after-return.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst index 4adcd7bbfa26c..4e2185a25e3ab 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst @@ -74,7 +74,7 @@ Options When `true`, the check will attempt to refactor a variable defined inside the condition of the ``if`` statement that is used in the ``else`` branch defining them just before the ``if`` statement. This can only be done if - the ``if`` statement is the last statement in its parents scope. + the ``if`` statement is the last statement in its parent's scope. Default value is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst index 79f6bf4ddf4f5..ffd2b2c68c8d2 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst @@ -67,8 +67,8 @@ The following structures increase the function's Cognitive Complexity metric Nesting level ^^^^^^^^^^^^^ -While by itself the nesting level not change the function's Cognitive Complexity -metric, it is tracked, and is used by the next, third building block. +While by itself the nesting level does not change the function's Cognitive +Complexity metric, it is tracked, and is used by the next, third building block. The following structures increase the nesting level (by `1`): * Conditional operators: 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 index 8e31c997ceb70..44d97f7b363bf 100644 --- 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 @@ The following options are described below: .. 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-identifier-naming.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst index 23a1ff8e542f5..a9f1d7bff228e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst @@ -33,7 +33,7 @@ This also applies for pseudo-override patterns like CRTP. Options ------- -The following options are describe below: +The following options are described below: - :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix` - :option:`AggressiveDependentMemberLookup` diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst index 1fac4220abea8..b00ddd149cece 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst @@ -9,7 +9,7 @@ code and not introduced via constants or symbols. Many coding guidelines advise replacing the magic values with symbolic constants to improve readability. Here are a few references: - * `Rule ES.45: Avoid “magic constants”; use symbolic constants in C++ Core Guidelines <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-magic>`_ + * `Rule ES.45: Avoid "magic constants"; use symbolic constants in C++ Core Guidelines <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-magic>`_ * `Rule 5.1.1 Use symbolic names instead of literal values in code in High Integrity C++ <http://www.codingstandard.com/rule/5-1-1-use-symbolic-names-instead-of-literal-values-in-code/>`_ * Item 17 in "C++ Coding Standards: 101 Rules, Guidelines and Best Practices" by Herb Sutter and Andrei Alexandrescu 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 index 6fd066d397c76..6098667e2d8c5 100644 --- 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 @@ Options auto *Foo2 = cast<const int *>(Bar2); auto &Foo3 = cast<const int &>(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/checks/readability-redundant-declaration.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst index 0cd05211469fd..2a7ecac73c4c1 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst @@ -16,7 +16,7 @@ becomes extern int X; -Such redundant declarations can be removed without changing program behaviour. +Such redundant declarations can be removed without changing program behavior. They can for instance be unintentional left overs from previous refactorings when code has been moved around. Having redundant declarations could in worst case mean that there are typos in the code that cause bugs. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst index 58d01d5537129..237f2810dc18d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst @@ -49,6 +49,6 @@ Examples: if (str1.compare("foo") == 0) { } -The above code examples shows the list of if-statements that this check will +The above code examples show the list of if-statements that this check will give a warning for. All of them uses ``compare`` to check if equality or inequality of two strings instead of using the correct operators. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst index a1e0f25834f34..fd567f331bfd2 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst @@ -109,10 +109,10 @@ This heuristic can be configured with :ref:`bounds<opt_Bounds>`. The default bounds are: below `50`\% dissimilar and above `66`\% similar. This heuristic is case-sensitive. -Jaro–Winkler distance (as `JaroWinkler`) +Jaro-Winkler distance (as `JaroWinkler`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The `Jaro–Winkler distance <http://en.wikipedia.org/wiki/Jaro–Winkler_distance>`_ +The `Jaro-Winkler distance <http://en.wikipedia.org/wiki/Jaro–Winkler_distance>`_ is an edit distance like the Levenshtein distance. It is calculated from the amount of common characters that are sufficiently close to each other in position, and to-be-changed characters. @@ -125,10 +125,10 @@ This heuristic can be configured with :ref:`bounds<opt_Bounds>`. The default bounds are: below `75`\% dissimilar and above `85`\% similar. This heuristic is case-insensitive. -Sørensen–Dice coefficient (as `Dice`) +Sørensen-Dice coefficient (as `Dice`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The `Sørensen–Dice coefficient <http://en.wikipedia.org/wiki/Sørensen–Dice_coefficient>`_ +The `Sørensen-Dice coefficient <http://en.wikipedia.org/wiki/Sørensen–Dice_coefficient>`_ was originally defined to measure the similarity of two sets. Formally, the coefficient is calculated by dividing `2 * #(intersection)` with `#(set1) + #(set2)`, where `#()` is the cardinality function of sets. diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst index 165dc4e30fe42..aa0301dc42b43 100644 --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -91,7 +91,7 @@ Name prefix Description Clang diagnostics are treated in a similar way as check diagnostics. Clang diagnostics are displayed by :program:`clang-tidy` and can be filtered out using ``-checks=`` option. However, the ``-checks=`` option does not affect -compilation arguments, so it can not turn on Clang warnings which are not +compilation arguments, so it cannot turn on Clang warnings which are not already turned on in build configuration. The ``-warnings-as-errors=`` option upgrades any warnings emitted under the ``-checks=`` flag to errors (but it does not enable any checks itself). @@ -281,10 +281,10 @@ Suppressing Undesired Diagnostics ================================= :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 <checks/bugprone-use-after-move.html>`_ can be +e.g. `bugprone-use-after-move <checks/bugprone-use-after-move.html>`_ can be silenced by re-initializing the variable after it has been moved out, `bugprone-string-integer-assignment <checks/bugprone-string-integer-assignment.html>`_ can be suppressed by _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits