[clang] 9b5b3ed - [clang-format][doc] Fix formatting, etc.
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 28 22:00:31 PST 2024
Author: Owen Pan
Date: 2024-11-28T22:00:23-08:00
New Revision: 9b5b3edd64e56af02295c0365269177443d4a64d
URL: https://github.com/llvm/llvm-project/commit/9b5b3edd64e56af02295c0365269177443d4a64d
DIFF: https://github.com/llvm/llvm-project/commit/9b5b3edd64e56af02295c0365269177443d4a64d.diff
LOG: [clang-format][doc] Fix formatting, etc.
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
clang/include/clang/Tooling/Inclusions/IncludeStyle.h
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index dc34094b5053a9..4be448171699ca 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3759,9 +3759,9 @@ the configuration (without a prefix: ``Auto``).
lists.
Important
diff erences:
- - No spaces inside the braced list.
- - No line break before the closing brace.
- - Indentation with the continuation indent, not with the block indent.
+ * No spaces inside the braced list.
+ * No line break before the closing brace.
+ * Indentation with the continuation indent, not with the block indent.
Fundamentally, C++11 braced lists are formatted exactly like function
calls would be formatted in their place. If the braced list follows a name
@@ -4104,10 +4104,10 @@ the configuration (without a prefix: ``Auto``).
When guessing whether a #include is the "main" include (to assign
category 0, see above), use this regex of allowed suffixes to the header
stem. A partial match is done, so that:
- - "" means "arbitrary suffix"
- - "$" means "no suffix"
+ * ``""`` means "arbitrary suffix"
+ * ``"$"`` means "no suffix"
- For example, if configured to "(_test)?$", then a header a.h would be seen
+ For example, if configured to ``"(_test)?$"``, then a header a.h would be seen
as the "main" include in both a.cc and a_test.cc.
.. _IncludeIsMainSourceRegex:
@@ -5313,21 +5313,21 @@ the configuration (without a prefix: ``Auto``).
**QualifierOrder** (``List of Strings``) :versionbadge:`clang-format 14` :ref:`¶ <QualifierOrder>`
The order in which the qualifiers appear.
- Order is an array that can contain any of the following:
+ The order is an array that can contain any of the following:
- * const
- * inline
- * static
- * friend
- * constexpr
- * volatile
- * restrict
- * type
+ * ``const``
+ * ``inline``
+ * ``static``
+ * ``friend``
+ * ``constexpr``
+ * ``volatile``
+ * ``restrict``
+ * ``type``
.. note::
- It **must** contain ``type``.
+ It must contain ``type``.
Items to the left of ``type`` will be placed to the left of the type and
aligned in the order supplied. Items to the right of ``type`` will be
@@ -6645,12 +6645,11 @@ the configuration (without a prefix: ``Auto``).
.. _StatementMacros:
**StatementMacros** (``List of Strings``) :versionbadge:`clang-format 8` :ref:`¶ <StatementMacros>`
- A vector of macros that should be interpreted as complete
- statements.
+ A vector of macros that should be interpreted as complete statements.
- Typical macros are expressions, and require a semi-colon to be
- added; sometimes this is not the case, and this allows to make
- clang-format aware of such cases.
+ Typical macros are expressions and require a semicolon to be added.
+ Sometimes this is not the case, and this allows to make clang-format aware
+ of such cases.
For example: Q_UNUSED
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index 056fad2cc0ff8c..6383934afa2c40 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2506,9 +2506,9 @@ struct FormatStyle {
/// lists.
///
/// Important
diff erences:
- /// - No spaces inside the braced list.
- /// - No line break before the closing brace.
- /// - Indentation with the continuation indent, not with the block indent.
+ /// * No spaces inside the braced list.
+ /// * No line break before the closing brace.
+ /// * Indentation with the continuation indent, not with the block indent.
///
/// Fundamentally, C++11 braced lists are formatted exactly like function
/// calls would be formatted in their place. If the braced list follows a name
@@ -3742,19 +3742,19 @@ struct FormatStyle {
QualifierAlignmentStyle QualifierAlignment;
/// The order in which the qualifiers appear.
- /// Order is an array that can contain any of the following:
+ /// The order is an array that can contain any of the following:
///
- /// * const
- /// * inline
- /// * static
- /// * friend
- /// * constexpr
- /// * volatile
- /// * restrict
- /// * type
+ /// * ``const``
+ /// * ``inline``
+ /// * ``static``
+ /// * ``friend``
+ /// * ``constexpr``
+ /// * ``volatile``
+ /// * ``restrict``
+ /// * ``type``
///
/// \note
- /// It **must** contain ``type``.
+ /// It must contain ``type``.
/// \endnote
///
/// Items to the left of ``type`` will be placed to the left of the type and
@@ -5449,10 +5449,10 @@ formatReplacements(StringRef Code, const tooling::Replacements &Replaces,
/// cleaning up the code after that on success; otherwise, return an llvm::Error
/// carrying llvm::StringError.
/// This also supports inserting/deleting C++ #include directives:
-/// - If a replacement has offset UINT_MAX, length 0, and a replacement text
+/// * If a replacement has offset UINT_MAX, length 0, and a replacement text
/// that is an #include directive, this will insert the #include into the
/// correct block in the \p Code.
-/// - If a replacement has offset UINT_MAX, length 1, and a replacement text
+/// * If a replacement has offset UINT_MAX, length 1, and a replacement text
/// that is the name of the header to be removed, the header will be removed
/// from \p Code if it exists.
/// The include manipulation is done via ``tooling::HeaderInclude``, see its
@@ -5558,13 +5558,12 @@ extern const char *DefaultFallbackStyle;
///
/// ``StyleName`` can take several forms:
/// * "{<key>: <value>, ...}" - Set specic style parameters.
-/// * "<style name>" - One of the style names supported by
-/// getPredefinedStyle().
+/// * "<style name>" - One of the style names supported by getPredefinedStyle().
/// * "file" - Load style configuration from a file called ``.clang-format``
-/// located in one of the parent directories of ``FileName`` or the current
-/// directory if ``FileName`` is empty.
+/// located in one of the parent directories of ``FileName`` or the current
+/// directory if ``FileName`` is empty.
/// * "file:<format_file_path>" to explicitly specify the configuration file to
-/// use.
+/// use.
///
/// \param[in] StyleName Style name to interpret according to the description
/// above.
diff --git a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
index d167b7e45467fe..fba90d8c51a663 100644
--- a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -123,10 +123,10 @@ struct IncludeStyle {
/// When guessing whether a #include is the "main" include (to assign
/// category 0, see above), use this regex of allowed suffixes to the header
/// stem. A partial match is done, so that:
- /// - "" means "arbitrary suffix"
- /// - "$" means "no suffix"
+ /// * ``""`` means "arbitrary suffix"
+ /// * ``"$"`` means "no suffix"
///
- /// For example, if configured to "(_test)?$", then a header a.h would be seen
+ /// For example, if configured to ``"(_test)?$"``, then a header a.h would be seen
/// as the "main" include in both a.cc and a_test.cc.
/// \version 3.9
std::string IncludeIsMainRegex;
More information about the cfe-commits
mailing list