Skip to content

Conversation

@zeyi2
Copy link
Contributor

@zeyi2 zeyi2 commented Nov 13, 2025

Fix documentation in hicpp, linuxkernel, llvm, llvmlibc, misc and modernize.

This is part of the codebase cleanup described in #167098

@llvmbot
Copy link
Member

llvmbot commented Nov 13, 2025

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clang-tidy

Author: mitchell (zeyi2)

Changes

Fix documentation in hicpp, linuxkernel, llvm, llvmlibc, misc and modernize.

This is part of the codebase cleanup described in #167098


Patch is 45.21 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/167830.diff

37 Files Affected:

  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/explicit-conversions.rst (+12-7)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/function-size.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/multiway-paths-covered.rst (+8-6)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/hicpp/uppercase-literal-suffix.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/linuxkernel/must-check-errs.rst (+2-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst (+12-11)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst (+14-12)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/header-include-cycle.rst (+8-8)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst (+2-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/no-recursion.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/override-with-different-visibility.rst (+6-5)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/throw-by-value-catch-by-reference.rst (+4-4)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/unused-parameters.rst (+3-3)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/unused-using-decls.rst (+4-3)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/misc/use-anonymous-namespace.rst (+6-6)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/avoid-setjmp-longjmp.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/avoid-variadic-functions.rst (+1-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/concat-nested-namespaces.rst (+4-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/loop-convert.rst (+5-4)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/replace-disallow-copy-and-assign-macro.rst (+3-3)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/replace-random-shuffle.rst (+16-5)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst (+2-1)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/unary-static-assert.rst (+3-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-auto.rst (+2-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-constraints.rst (+2-2)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-designated-initializers.rst (+5-5)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-emplace.rst (+13-10)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-equals-delete.rst (+3-3)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-std-print.rst (+4-3)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-trailing-return-type.rst (+8-4)
  • (modified) clang-tools-extra/docs/clang-tidy/checks/modernize/use-using.rst (+2-2)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst
index 15a410e0d71cc..cd8b038753008 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/braces-around-statements.rst
@@ -6,6 +6,7 @@ hicpp-braces-around-statements
 ==============================
 
 The `hicpp-braces-around-statements` check is an alias, please see
-:doc:`readability-braces-around-statements <../readability/braces-around-statements>`
+:doc:`readability-braces-around-statements
+<../readability/braces-around-statements>`
 for more information.
 It enforces the `rule 6.1.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/statements>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/explicit-conversions.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/explicit-conversions.rst
index d8c69399d6d65..627644a40278f 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/explicit-conversions.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/explicit-conversions.rst
@@ -7,11 +7,16 @@ hicpp-explicit-conversions
 
 This check is an alias for :doc:`google-explicit-constructor <../google/explicit-constructor>`.
 Used to enforce parts of `rule 5.4.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard-expressions>`_.
-This check will enforce that constructors and conversion operators are marked `explicit`.
-Other forms of casting checks are implemented in other places.
-The following checks can be used to check for more forms of casting:
+This check will enforce that constructors and conversion operators are
+marked `explicit`. Other forms of casting checks are implemented in
+other places. The following checks can be used to check for more forms
+of casting:
 
-- :doc:`cppcoreguidelines-pro-type-static-cast-downcast <../cppcoreguidelines/pro-type-static-cast-downcast>`
-- :doc:`cppcoreguidelines-pro-type-reinterpret-cast <../cppcoreguidelines/pro-type-reinterpret-cast>`
-- :doc:`cppcoreguidelines-pro-type-const-cast <../cppcoreguidelines/pro-type-const-cast>`
-- :doc:`cppcoreguidelines-pro-type-cstyle-cast <../cppcoreguidelines/pro-type-cstyle-cast>`
+- :doc:`cppcoreguidelines-pro-type-static-cast-downcast
+  <../cppcoreguidelines/pro-type-static-cast-downcast>`
+- :doc:`cppcoreguidelines-pro-type-reinterpret-cast
+  <../cppcoreguidelines/pro-type-reinterpret-cast>`
+- :doc:`cppcoreguidelines-pro-type-const-cast
+  <../cppcoreguidelines/pro-type-const-cast>`
+- :doc:`cppcoreguidelines-pro-type-cstyle-cast
+  <../cppcoreguidelines/pro-type-cstyle-cast>`
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/function-size.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/function-size.rst
index 5ccf670ed55a3..ad91c2514c97f 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/function-size.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/function-size.rst
@@ -5,7 +5,8 @@
 hicpp-function-size
 ===================
 
-This check is an alias for :doc:`readability-function-size <../readability/function-size>`.
+This check is an alias for
+:doc:`readability-function-size <../readability/function-size>`.
 Useful to enforce multiple sections on function complexity.
 
 - `rule 8.2.2 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/definitions>`_
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.rst
index 6ca704ae3e66c..4a89949ce45d7 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/ignored-remove-result.rst
@@ -13,7 +13,8 @@ operating over. On completion, they return an iterator to the last valid
 element. In the majority of cases the correct behavior is to use this result as
 the first operand in a call to ``std::erase``.
 
-This check is a subset of :doc:`bugprone-unused-return-value <../bugprone/unused-return-value>`
+This check is a subset of :doc:`bugprone-unused-return-value
+<../bugprone/unused-return-value>`
 and depending on used options it can be superfluous to enable both checks.
 
 Options
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst
index 13184d46380cb..fd2e04a0fc711 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/invalid-access-moved.rst
@@ -5,6 +5,7 @@
 hicpp-invalid-access-moved
 ==========================
 
-This check is an alias for :doc:`bugprone-use-after-move <../bugprone/use-after-move>`.
+This check is an alias for
+:doc:`bugprone-use-after-move <../bugprone/use-after-move>`.
 
 Implements parts of the `rule 8.4.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/definitions>`_ to check if moved-from objects are accessed.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst
index b43c23344f2e2..7af8401602328 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/move-const-arg.rst
@@ -6,5 +6,6 @@ hicpp-move-const-arg
 ====================
 
 The `hicpp-move-const-arg` check is an alias, please see
-:doc:`performance-move-const-arg <../performance/move-const-arg>` for more information.
+:doc:`performance-move-const-arg <../performance/move-const-arg>`
+for more information.
 It enforces the `rule 17.3.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-library>`_.
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 983de34e36731..f164f4c0b2f48 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
@@ -4,15 +4,16 @@ hicpp-multiway-paths-covered
 ============================
 
 This check discovers situations where code paths are not fully-covered.
-It furthermore suggests using ``if`` instead of ``switch`` if the code will be more clear.
+It furthermore suggests using ``if`` instead of ``switch`` if the code
+will be more clear.
 The `rule 6.1.2 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/statements>`_
 and `rule 6.1.4 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/statements>`_
 of the High Integrity C++ Coding Standard are enforced.
 
-``if-else if`` chains that miss a final ``else`` branch might lead to unexpected
-program execution and be the result of a logical error.
-If the missing ``else`` branch is intended you can leave it empty with a clarifying
-comment.
+``if-else if`` chains that miss a final ``else`` branch might lead to
+unexpected program execution and be the result of a logical error.
+If the missing ``else`` branch is intended you can leave it empty with
+a clarifying comment.
 This warning can be noisy on some code bases, so it is disabled by default.
 
 .. code-block:: c++
@@ -28,7 +29,8 @@ This warning can be noisy on some code bases, so it is disabled by default.
      // ...
   }
 
-Similar arguments hold for ``switch`` statements which do not cover all possible code paths.
+Similar arguments hold for ``switch`` statements which do not cover all
+possible code paths.
 
 .. code-block:: c++
 
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst
index 7f894b11b6b60..4506596946ead 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/named-parameter.rst
@@ -5,6 +5,7 @@
 hicpp-named-parameter
 =====================
 
-This check is an alias for :doc:`readability-named-parameter <../readability/named-parameter>`.
+This check is an alias for :doc:`readability-named-parameter
+<../readability/named-parameter>`.
 
 Implements `rule 8.2.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/definitions>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst
index 85b93cb99a18d..715a1b7638e8b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/no-array-decay.rst
@@ -6,6 +6,7 @@ hicpp-no-array-decay
 ====================
 
 The `hicpp-no-array-decay` check is an alias, please see
-:doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay <../cppcoreguidelines/pro-bounds-array-to-pointer-decay>`
+:doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay
+<../cppcoreguidelines/pro-bounds-array-to-pointer-decay>`
 for more information.
 It enforces the `rule 4.1.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-conversions>`_.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp/uppercase-literal-suffix.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp/uppercase-literal-suffix.rst
index 994363accc8c6..34b9f255a44c8 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/hicpp/uppercase-literal-suffix.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp/uppercase-literal-suffix.rst
@@ -6,7 +6,8 @@ hicpp-uppercase-literal-suffix
 ==============================
 
 The hicpp-uppercase-literal-suffix check is an alias, please see
-:doc:`readability-uppercase-literal-suffix <../readability/uppercase-literal-suffix>` for more information.
+:doc:`readability-uppercase-literal-suffix
+<../readability/uppercase-literal-suffix>` for more information.
 
 Partially implements `rule 4.2.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/standard-conversions>`_
 to ensure that the ``U`` suffix is writeln properly.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/linuxkernel/must-check-errs.rst b/clang-tools-extra/docs/clang-tidy/checks/linuxkernel/must-check-errs.rst
index cef5a70db309e..6a4b743665964 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/linuxkernel/must-check-errs.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/linuxkernel/must-check-errs.rst
@@ -4,8 +4,8 @@ linuxkernel-must-check-errs
 ===========================
 
 Checks Linux kernel code to see if it uses the results from the functions in
-``linux/err.h``. Also checks to see if code uses the results from functions that
-directly return a value from one of these error functions.
+``linux/err.h``. Also checks to see if code uses the results from functions
+that directly return a value from one of these error functions.
 
 This is important in the Linux kernel because ``ERR_PTR``, ``PTR_ERR``,
 ``IS_ERR``, ``IS_ERR_OR_NULL``, ``ERR_CAST``, and ``PTR_ERR_OR_ZERO`` return
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst
index 18ec10be347dc..01f3b75fc1ffa 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/const-correctness.rst
@@ -4,14 +4,14 @@ misc-const-correctness
 ======================
 
 This check implements detection of local variables which could be declared as
-``const`` but are not. Declaring variables as ``const`` is required or recommended by many
-coding guidelines, such as:
+``const`` but are not. Declaring variables as ``const`` is required or
+recommended by many coding guidelines, such as:
 `ES.25 <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es25-declare-an-object-const-or-constexpr-unless-you-want-to-modify-its-value-later-on>`_
 from the C++ Core Guidelines.
 
-Please note that this check's analysis is type-based only. Variables that are not modified
-but used to create a non-const handle that might escape the scope are not diagnosed
-as potential ``const``.
+Please note that this check's analysis is type-based only. Variables that are
+not modified but used to create a non-const handle that might escape the scope
+are not diagnosed as potential ``const``.
 
 .. code-block:: c++
 
@@ -44,8 +44,8 @@ The check can analyze values, pointers and references and pointees:
   int const*const pointer_variable = &potential_const_int; // After transformation, both pointer itself and pointee are supported.
   int last_copy = *pointer_variable;
 
-The automatic code transformation is only applied to variables that are declared in single
-declarations. You may want to prepare your code base with
+The automatic code transformation is only applied to variables that are
+declared in single declarations. You may want to prepare your code base with
 :doc:`readability-isolate-declaration <../readability/isolate-declaration>` first.
 
 Note that there is the check
@@ -58,10 +58,11 @@ Limitations
 
 The check does not run on `C` code.
 
-The check will not analyze templated variables or variables that are instantiation dependent.
-Different instantiations can result in different ``const`` correctness properties and in general it
-is not possible to find all instantiations of a template. The template might be used differently in
-an independent translation unit.
+The check will not analyze templated variables or variables that are
+instantiation dependent. Different instantiations can result in
+different ``const`` correctness properties and in general it is not
+possible to find all instantiations of a template. The template might
+be used differently in an independent translation unit.
 
 Options
 -------
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst
index 0b054e4e20bd6..774b42ddba65e 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/coroutine-hostile-raii.rst
@@ -7,21 +7,23 @@ Detects when objects of certain hostile RAII types persists across suspension
 points in a coroutine. Such hostile types include scoped-lockable types and
 types belonging to a configurable denylist.
 
-Some objects require that they be destroyed on the same thread that created them.
-Traditionally this requirement was often phrased as "must be a local variable",
-under the assumption that local variables always work this way. However this is
-incorrect with C++20 coroutines, since an intervening ``co_await`` may cause the
-coroutine to suspend and later be resumed on another thread.
-
-The lifetime of an object that requires being destroyed on the same thread must
-not encompass a ``co_await`` or ``co_yield`` point. If you create/destroy an object,
-you must do so without allowing the coroutine to suspend in the meantime.
+Some objects require that they be destroyed on the same thread that created
+them. Traditionally this requirement was often phrased as "must be a local
+variable", under the assumption that local variables always work this way.
+However this is incorrect with C++20 coroutines, since an intervening
+``co_await`` may cause the coroutine to suspend and later be resumed on
+another thread.
+
+The lifetime of an object that requires being destroyed on the same thread
+must not encompass a ``co_await`` or ``co_yield`` point. If you create/destroy
+an object, you must do so without allowing the coroutine to suspend in the
+meantime.
 
 Following types are considered as hostile:
 
- - Scoped-lockable types: A scoped-lockable object persisting across a suspension
-   point is problematic as the lock held by this object could be unlocked by a
-   different thread. This would be undefined behaviour.
+ - Scoped-lockable types: A scoped-lockable object persisting across a
+   suspension point is problematic as the lock held by this object could
+   be unlocked by a different thread. This would be undefined behaviour.
    This includes all types annotated with the ``scoped_lockable`` attribute.
 
  - Types belonging to a configurable denylist.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/header-include-cycle.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/header-include-cycle.rst
index de08f0d0bea07..d0ae0ea84aad4 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/header-include-cycle.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/header-include-cycle.rst
@@ -47,18 +47,18 @@ quality, and a more maintainable codebase overall. Additionally, by ensuring
 that header files are organized in a way that avoids cyclic dependencies,
 developers can make their code easier to understand and modify over time.
 
-It's worth noting that only user-defined headers their dependencies are analyzed,
-System includes such as standard library headers and third-party library headers
-are excluded. System includes are usually well-designed and free of include
-cycles, and ignoring them helps to focus on potential issues within the
-project's own codebase. This limitation doesn't diminish the ability to detect
-``#include`` cycles within the analyzed code.
+It's worth noting that only user-defined headers their dependencies are
+analyzed, system includes such as standard library headers and third-party
+library headers are excluded. System includes are usually well-designed and
+free of include cycles, and ignoring them helps to focus on potential issues
+within the project's own codebase. This limitation doesn't diminish the
+ability to detect ``#include`` cycles within the analyzed code.
 
 Developers should carefully review any warnings or feedback provided by this
 solution. While the analysis aims to identify and prevent include cycles, there
 may be situations where exceptions or modifications are necessary. It's
-important to exercise judgment and consider the specific context of the codebase
-when making adjustments.
+important to exercise judgment and consider the specific context of the
+codebase when making adjustments.
 
 Options
 -------
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst
index 1e2b61ac67345..5941d1ca9b9c0 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/misleading-identifier.rst
@@ -4,8 +4,8 @@ misc-misleading-identifier
 ==========================
 
 Finds identifiers that contain Unicode characters with right-to-left direction,
-which can be confusing as they may change the understanding of a whole statement
-line, as described in `Trojan Source <https://trojansource.codes>`_.
+which can be confusing as they may change the understanding of a whole
+statement line, as described in `Trojan Source <https://trojansource.codes>`_.
 
 An example of such misleading code follows:
 
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/no-recursion.rst b/clang-tools-extra/docs/clang-tidy/checks/misc/no-recursion.rst
index 1c04dbfcad532..53753f1d029d0 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc/no-recursion.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc/no-recursion.rst
@@ -11,7 +11,8 @@ and displays one example of a possible call graph loop (recursion).
 References:
 
 * CERT C++ Coding Standard rule `DCL56-CPP. Avoid cycles during initialization of static objects <https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL56-CPP.+Avoid+cycles+during+initialization+of+static+objects>`_.
-* JPL Institutional Coding Standard for the C Programming Language (JPL DOCID D-60411) rule `2.4 Do not use direct or indirect recursion`.
+* JPL Institutional Coding Standard for the C Programming Language
+  (JPL DOCID D-60411) rule `2.4 Do not use direct or indirect recursion`.
 * OpenCL Specification, Version 1.2 rule `6.9 Restrictions: i. Recursion is not supported. <https://www.khronos.org/registry/OpenCL/specs/opencl-1.2.pdf>`_.
 
 
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc/override-with-different-visibility.rst b/clang-tools-extra/docs/clang-tidy/checks/mis...
[truncated]

Comment on lines 9 to 12
:doc:`readability-braces-around-statements <../readability/braces-around-statements>`
:doc:`readability-braces-around-statements
<../readability/braces-around-statements>`
for more information.
It enforces the `rule 6.1.1 <https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/statements>`_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct that linter does flag :doc: but don't flag rule 6.1.1...?

Copy link
Contributor Author

@zeyi2 zeyi2 Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct that linter does flag :doc: but don't flag rule 6.1.1...?

I think the linter automatically ignores lines containing URLs:

  • lines should not be longer than 79 characters - D001
    • RST exception: line with no whitespace except in the beginning
    • RST exception: lines with http or https urls
    • RST exception: literal blocks
    • RST exception: rst target directives

I will wrap this line to make it shorter.

hicpp-explicit-conversions
==========================

This check is an alias for :doc:`google-explicit-constructor <../google/explicit-constructor>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this flagged? It seems longer that paths which you transformed in this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this flagged? It seems longer that paths which you transformed in this file

I think this is a bug, when I removed the remaining parts of the document, it flagged. But it passes with the original file.

Comment on lines 14 to 22
- :doc:`cppcoreguidelines-pro-type-static-cast-downcast <../cppcoreguidelines/pro-type-static-cast-downcast>`
- :doc:`cppcoreguidelines-pro-type-reinterpret-cast <../cppcoreguidelines/pro-type-reinterpret-cast>`
- :doc:`cppcoreguidelines-pro-type-const-cast <../cppcoreguidelines/pro-type-const-cast>`
- :doc:`cppcoreguidelines-pro-type-cstyle-cast <../cppcoreguidelines/pro-type-cstyle-cast>`
- :doc:`cppcoreguidelines-pro-type-static-cast-downcast
<../cppcoreguidelines/pro-type-static-cast-downcast>`
- :doc:`cppcoreguidelines-pro-type-reinterpret-cast
<../cppcoreguidelines/pro-type-reinterpret-cast>`
- :doc:`cppcoreguidelines-pro-type-const-cast
<../cppcoreguidelines/pro-type-const-cast>`
- :doc:`cppcoreguidelines-pro-type-cstyle-cast
<../cppcoreguidelines/pro-type-cstyle-cast>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little unfortunate that we had to do this transformation because it makes list ugly IMO.
Can the linter increate line length for :doc statements? Say to 90 or 100

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little unfortunate that we had to do this transformation because it makes list ugly IMO. Can the linter increate line length for :doc statements? Say to 90 or 100

I hate to say it but I don't think it is possible, IMO we can fix the remaining part of the document, then let the linter ignore this file's long line error (other checks will still work). WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if its not possible lets leave as is.

Used to enforce parts of `rule 5.4.1
<https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard-expressions>`_.
This check will enforce that constructors and conversion operators are
marked `explicit`. Other forms of casting checks are implemented in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
marked `explicit`. Other forms of casting checks are implemented in
marked ``explicit``. Other forms of casting checks are implemented in

The check is similar to the ``-Wunused-parameter`` compiler diagnostic and can be
used to prepare a codebase to enabling of that diagnostic. By default the check
is more permissive (see :option:`StrictMode`).
The check is similar to the ``-Wunused-parameter`` compiler diagnostic and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The check is similar to the ``-Wunused-parameter`` compiler diagnostic and
The check is similar to the `-Wunused-parameter` compiler diagnostic and

The check diagnoses any ``static_assert`` declaration with an empty string literal
and provides a fix-it to replace the declaration with a single-argument ``static_assert`` declaration.
The check diagnoses any ``static_assert`` declaration with an
empty string literal and provides a fix-it to replace the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
empty string literal and provides a fix-it to replace the
empty string literal and provides a fix-it note to replace the

Comment on lines 41 to 42
``-Wc99-designator`` to get support for mixed designators in initializer list
in C and ``-Wc++20-designator`` for support of designated initializers in older
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``-Wc99-designator`` to get support for mixed designators in initializer list
in C and ``-Wc++20-designator`` for support of designated initializers in older
`-Wc99-designator` to get support for mixed designators in initializer list
in C and `-Wc++20-designator` for support of designated initializers in older

options. Each argument that is the result of a call to
``std::string::c_str()`` and ``std::string::data()`` will have that
now-unnecessary call removed in a similar manner to the
`readability-redundant-string-cstr` check.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be link.

options. Each argument that is the result of a call to
``std::string::c_str()`` and ``std::string::data()`` will have that
now-unnecessary call removed in a similar manner to the
`readability-redundant-string-cstr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing :doc:?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants