Skip to content

Commit 9b5b3ed

Browse files
committed
[clang-format][doc] Fix formatting, etc.
1 parent 9b163d2 commit 9b5b3ed

File tree

3 files changed

+42
-44
lines changed

3 files changed

+42
-44
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3759,9 +3759,9 @@ the configuration (without a prefix: ``Auto``).
37593759
lists.
37603760

37613761
Important differences:
3762-
- No spaces inside the braced list.
3763-
- No line break before the closing brace.
3764-
- Indentation with the continuation indent, not with the block indent.
3762+
* No spaces inside the braced list.
3763+
* No line break before the closing brace.
3764+
* Indentation with the continuation indent, not with the block indent.
37653765

37663766
Fundamentally, C++11 braced lists are formatted exactly like function
37673767
calls would be formatted in their place. If the braced list follows a name
@@ -4104,10 +4104,10 @@ the configuration (without a prefix: ``Auto``).
41044104
When guessing whether a #include is the "main" include (to assign
41054105
category 0, see above), use this regex of allowed suffixes to the header
41064106
stem. A partial match is done, so that:
4107-
- "" means "arbitrary suffix"
4108-
- "$" means "no suffix"
4107+
* ``""`` means "arbitrary suffix"
4108+
* ``"$"`` means "no suffix"
41094109

4110-
For example, if configured to "(_test)?$", then a header a.h would be seen
4110+
For example, if configured to ``"(_test)?$"``, then a header a.h would be seen
41114111
as the "main" include in both a.cc and a_test.cc.
41124112

41134113
.. _IncludeIsMainSourceRegex:
@@ -5313,21 +5313,21 @@ the configuration (without a prefix: ``Auto``).
53135313

53145314
**QualifierOrder** (``List of Strings``) :versionbadge:`clang-format 14` :ref:`<QualifierOrder>`
53155315
The order in which the qualifiers appear.
5316-
Order is an array that can contain any of the following:
5316+
The order is an array that can contain any of the following:
53175317

5318-
* const
5319-
* inline
5320-
* static
5321-
* friend
5322-
* constexpr
5323-
* volatile
5324-
* restrict
5325-
* type
5318+
* ``const``
5319+
* ``inline``
5320+
* ``static``
5321+
* ``friend``
5322+
* ``constexpr``
5323+
* ``volatile``
5324+
* ``restrict``
5325+
* ``type``
53265326

53275327

53285328
.. note::
53295329

5330-
It **must** contain ``type``.
5330+
It must contain ``type``.
53315331

53325332
Items to the left of ``type`` will be placed to the left of the type and
53335333
aligned in the order supplied. Items to the right of ``type`` will be
@@ -6645,12 +6645,11 @@ the configuration (without a prefix: ``Auto``).
66456645
.. _StatementMacros:
66466646

66476647
**StatementMacros** (``List of Strings``) :versionbadge:`clang-format 8` :ref:`<StatementMacros>`
6648-
A vector of macros that should be interpreted as complete
6649-
statements.
6648+
A vector of macros that should be interpreted as complete statements.
66506649

6651-
Typical macros are expressions, and require a semi-colon to be
6652-
added; sometimes this is not the case, and this allows to make
6653-
clang-format aware of such cases.
6650+
Typical macros are expressions and require a semicolon to be added.
6651+
Sometimes this is not the case, and this allows to make clang-format aware
6652+
of such cases.
66546653

66556654
For example: Q_UNUSED
66566655

clang/include/clang/Format/Format.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,9 +2506,9 @@ struct FormatStyle {
25062506
/// lists.
25072507
///
25082508
/// Important differences:
2509-
/// - No spaces inside the braced list.
2510-
/// - No line break before the closing brace.
2511-
/// - Indentation with the continuation indent, not with the block indent.
2509+
/// * No spaces inside the braced list.
2510+
/// * No line break before the closing brace.
2511+
/// * Indentation with the continuation indent, not with the block indent.
25122512
///
25132513
/// Fundamentally, C++11 braced lists are formatted exactly like function
25142514
/// calls would be formatted in their place. If the braced list follows a name
@@ -3742,19 +3742,19 @@ struct FormatStyle {
37423742
QualifierAlignmentStyle QualifierAlignment;
37433743

37443744
/// The order in which the qualifiers appear.
3745-
/// Order is an array that can contain any of the following:
3745+
/// The order is an array that can contain any of the following:
37463746
///
3747-
/// * const
3748-
/// * inline
3749-
/// * static
3750-
/// * friend
3751-
/// * constexpr
3752-
/// * volatile
3753-
/// * restrict
3754-
/// * type
3747+
/// * ``const``
3748+
/// * ``inline``
3749+
/// * ``static``
3750+
/// * ``friend``
3751+
/// * ``constexpr``
3752+
/// * ``volatile``
3753+
/// * ``restrict``
3754+
/// * ``type``
37553755
///
37563756
/// \note
3757-
/// It **must** contain ``type``.
3757+
/// It must contain ``type``.
37583758
/// \endnote
37593759
///
37603760
/// 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,
54495449
/// cleaning up the code after that on success; otherwise, return an llvm::Error
54505450
/// carrying llvm::StringError.
54515451
/// This also supports inserting/deleting C++ #include directives:
5452-
/// - If a replacement has offset UINT_MAX, length 0, and a replacement text
5452+
/// * If a replacement has offset UINT_MAX, length 0, and a replacement text
54535453
/// that is an #include directive, this will insert the #include into the
54545454
/// correct block in the \p Code.
5455-
/// - If a replacement has offset UINT_MAX, length 1, and a replacement text
5455+
/// * If a replacement has offset UINT_MAX, length 1, and a replacement text
54565456
/// that is the name of the header to be removed, the header will be removed
54575457
/// from \p Code if it exists.
54585458
/// The include manipulation is done via ``tooling::HeaderInclude``, see its
@@ -5558,13 +5558,12 @@ extern const char *DefaultFallbackStyle;
55585558
///
55595559
/// ``StyleName`` can take several forms:
55605560
/// * "{<key>: <value>, ...}" - Set specic style parameters.
5561-
/// * "<style name>" - One of the style names supported by
5562-
/// getPredefinedStyle().
5561+
/// * "<style name>" - One of the style names supported by getPredefinedStyle().
55635562
/// * "file" - Load style configuration from a file called ``.clang-format``
5564-
/// located in one of the parent directories of ``FileName`` or the current
5565-
/// directory if ``FileName`` is empty.
5563+
/// located in one of the parent directories of ``FileName`` or the current
5564+
/// directory if ``FileName`` is empty.
55665565
/// * "file:<format_file_path>" to explicitly specify the configuration file to
5567-
/// use.
5566+
/// use.
55685567
///
55695568
/// \param[in] StyleName Style name to interpret according to the description
55705569
/// above.

clang/include/clang/Tooling/Inclusions/IncludeStyle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ struct IncludeStyle {
123123
/// When guessing whether a #include is the "main" include (to assign
124124
/// category 0, see above), use this regex of allowed suffixes to the header
125125
/// stem. A partial match is done, so that:
126-
/// - "" means "arbitrary suffix"
127-
/// - "$" means "no suffix"
126+
/// * ``""`` means "arbitrary suffix"
127+
/// * ``"$"`` means "no suffix"
128128
///
129-
/// For example, if configured to "(_test)?$", then a header a.h would be seen
129+
/// For example, if configured to ``"(_test)?$"``, then a header a.h would be seen
130130
/// as the "main" include in both a.cc and a_test.cc.
131131
/// \version 3.9
132132
std::string IncludeIsMainRegex;

0 commit comments

Comments
 (0)