[clang-tools-extra] [clang-tidy][NFC] Fix formatting issue in `clang-tidy` documentations (PR #168722)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 13 23:28:13 PST 2025
https://github.com/zeyi2 updated https://github.com/llvm/llvm-project/pull/168722
>From 4908ebaa5652957761db6116a3e4c823877fd9e3 Mon Sep 17 00:00:00 2001
From: mtx <mitchell.xu2 at gmail.com>
Date: Wed, 19 Nov 2025 23:19:32 +0800
Subject: [PATCH] [clang-tidy][NFC] Fix formatting issue in
`unsafe-functions.rst`
---
.../checks/bugprone/unsafe-functions.rst | 29 ++++++++++---------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unsafe-functions.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unsafe-functions.rst
index cb7ea415c54b2..e907326f8978a 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unsafe-functions.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unsafe-functions.rst
@@ -96,21 +96,22 @@ to be checked. The format is the following, without newlines:
The functions are matched using POSIX extended regular expressions.
*(Note: The regular expressions do not support negative* ``(?!)`` *matches.)*
-The ``reason`` is optional and is used to provide additional information about the
-reasoning behind the replacement. The default reason is ``is marked as unsafe``.
+The ``reason`` is optional and is used to provide additional information about
+the reasoning behind the replacement. The default reason is
+``is marked as unsafe``.
If ``replacement`` is empty, the default text ``it should not be used`` will be
shown instead of the suggestion for a replacement.
-If the ``reason`` starts with the character ``>``, the reason becomes fully custom.
-The default suffix is disabled even if a ``replacement`` is present, and only the
-reason message is shown after the matched function, to allow better control over
-the suggestions. (The starting ``>`` and whitespace directly after it are
-trimmed from the message.)
+If the ``reason`` starts with the character ``>``, the reason becomes fully
+custom. The default suffix is disabled even if a ``replacement`` is present,
+and only the reason message is shown after the matched function, to allow
+better control over the suggestions. (The starting ``>`` and whitespace
+directly after it are trimmed from the message.)
-As an example, the following configuration matches only the function ``original``
-in the default namespace. A similar diagnostic can also be printed using a fully
-custom reason.
+As an example, the following configuration matches only the function
+``original`` in the default namespace. A similar diagnostic can also be printed
+using a fully custom reason.
.. code:: c
@@ -123,10 +124,10 @@ custom reason.
::std::original(); // no-warning
original_function(); // no-warning
-If the regular expression contains the character ``:``, it is matched against the
-qualified name (i.e. ``std::original``), otherwise the regex is matched against
-the unqualified name (``original``). If the regular expression starts with ``::``
-(or ``^::``), it is matched against the fully qualified name
+If the regular expression contains the character ``:``, it is matched against
+the qualified name (i.e. ``std::original``), otherwise the regex is matched
+against the unqualified name (``original``). If the regular expression starts
+with ``::`` (or ``^::``), it is matched against the fully qualified name
(``::std::original``).
One of the use cases for fully custom messages is suggesting compiler options
More information about the cfe-commits
mailing list