[clang] 2fbc9f2 - [clang-format][doc] Clean up quotes, etc.
Owen Pan via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 2 16:45:27 PDT 2024
Author: Owen Pan
Date: 2024-06-02T16:45:17-07:00
New Revision: 2fbc9f217e5fe8db8444a87dbd7138a768b8aa85
URL: https://github.com/llvm/llvm-project/commit/2fbc9f217e5fe8db8444a87dbd7138a768b8aa85
DIFF: https://github.com/llvm/llvm-project/commit/2fbc9f217e5fe8db8444a87dbd7138a768b8aa85.diff
LOG: [clang-format][doc] Clean up quotes, etc.
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 1a7d0e6a05e31..677dac25df68e 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -1799,8 +1799,8 @@ the configuration (without a prefix: ``Auto``).
Never merge functions into a single line.
* ``SFS_InlineOnly`` (in configuration: ``InlineOnly``)
- Only merge functions defined inside a class. Same as "inline",
- except it does not implies "empty": i.e. top level empty functions
+ Only merge functions defined inside a class. Same as ``inline``,
+ except it does not implies ``empty``: i.e. top level empty functions
are not merged either.
.. code-block:: c++
@@ -1825,7 +1825,7 @@ the configuration (without a prefix: ``Auto``).
}
* ``SFS_Inline`` (in configuration: ``Inline``)
- Only merge functions defined inside a class. Implies "empty".
+ Only merge functions defined inside a class. Implies ``empty``.
.. code-block:: c++
@@ -2042,7 +2042,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- AttributeMacros: ['__capability', '__output', '__unused']
+ AttributeMacros: [__capability, __output, __unused]
.. _BinPackArguments:
@@ -3802,7 +3802,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- ForEachMacros: ['RANGES_FOR', 'FOREACH']
+ ForEachMacros: [RANGES_FOR, FOREACH]
For example: BOOST_FOREACH.
@@ -3825,7 +3825,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- IfMacros: ['IF']
+ IfMacros: [IF]
For example: `KJ_IF_MAYBE
<https://github.com/capnproto/capnproto/blob/master/kjdoc/tour.md#maybes>`_
@@ -4374,7 +4374,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- JavaImportGroups: ['com.example', 'com', 'org']
+ JavaImportGroups: [com.example, com, org]
.. code-block:: java
@@ -4438,7 +4438,7 @@ the configuration (without a prefix: ``Auto``).
VeryLongImportsAreAnnoying,
VeryLongImportsAreAnnoying,
VeryLongImportsAreAnnoying,
- } from 'some/module.js'
+ } from "some/module.js"
false:
import {VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying,} from "some/module.js"
@@ -5088,7 +5088,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- QualifierOrder: ['inline', 'static', 'type', 'const']
+ QualifierOrder: [inline, static, type, const]
.. code-block:: c++
@@ -5117,16 +5117,16 @@ the configuration (without a prefix: ``Auto``).
.. 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
+ 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
placed to the right of the type and aligned in the order supplied.
.. code-block:: yaml
- QualifierOrder: ['inline', 'static', 'type', 'const', 'volatile' ]
+ QualifierOrder: [inline, static, type, const, volatile]
.. _RawStringFormats:
@@ -5138,10 +5138,10 @@ the configuration (without a prefix: ``Auto``).
name will be reformatted assuming the specified language based on the
style for that language defined in the .clang-format file. If no style has
been defined in the .clang-format file for the specific language, a
- predefined style given by 'BasedOnStyle' is used. If 'BasedOnStyle' is not
- found, the formatting is based on llvm style. A matching delimiter takes
- precedence over a matching enclosing function name for determining the
- language of the raw string contents.
+ predefined style given by ``BasedOnStyle`` is used. If ``BasedOnStyle`` is
+ not found, the formatting is based on ``LLVM`` style. A matching delimiter
+ takes precedence over a matching enclosing function name for determining
+ the language of the raw string contents.
If a canonical delimiter is specified, occurrences of other delimiters for
the same language will be updated to the canonical if possible.
@@ -5156,17 +5156,17 @@ the configuration (without a prefix: ``Auto``).
RawStringFormats:
- Language: TextProto
Delimiters:
- - 'pb'
- - 'proto'
+ - pb
+ - proto
EnclosingFunctions:
- - 'PARSE_TEXT_PROTO'
+ - PARSE_TEXT_PROTO
BasedOnStyle: google
- Language: Cpp
Delimiters:
- - 'cc'
- - 'cpp'
- BasedOnStyle: llvm
- CanonicalDelimiter: 'cc'
+ - cc
+ - cpp
+ BasedOnStyle: LLVM
+ CanonicalDelimiter: cc
.. _ReferenceAlignment:
@@ -5533,7 +5533,7 @@ the configuration (without a prefix: ``Auto``).
This determines the maximum length of short namespaces by counting
unwrapped lines (i.e. containing neither opening nor closing
- namespace brace) and makes "FixNamespaceComments" omit adding
+ namespace brace) and makes ``FixNamespaceComments`` omit adding
end comments for those.
.. code-block:: c++
@@ -5645,7 +5645,7 @@ the configuration (without a prefix: ``Auto``).
* ``SUD_Lexicographic`` (in configuration: ``Lexicographic``)
Using declarations are sorted in the order defined as follows:
- Split the strings by "::" and discard any initial empty strings. Sort
+ Split the strings by ``::`` and discard any initial empty strings. Sort
the lists of names lexicographically, and within those groups, names are
in case-insensitive lexicographic order.
@@ -5659,7 +5659,7 @@ the configuration (without a prefix: ``Auto``).
* ``SUD_LexicographicNumeric`` (in configuration: ``LexicographicNumeric``)
Using declarations are sorted in the order defined as follows:
- Split the strings by "::" and discard any initial empty strings. The
+ Split the strings by ``::`` and discard any initial empty strings. The
last element of each list is a non-namespace name; all others are
namespace names. Sort the lists of names lexicographically, where the
sort order of individual names is that all non-namespace names come
@@ -5699,7 +5699,7 @@ the configuration (without a prefix: ``Auto``).
.. _SpaceAfterTemplateKeyword:
**SpaceAfterTemplateKeyword** (``Boolean``) :versionbadge:`clang-format 4` :ref:`ΒΆ <SpaceAfterTemplateKeyword>`
- If ``true``, a space will be inserted after the 'template' keyword.
+ If ``true``, a space will be inserted after the ``template`` keyword.
.. code-block:: c++
@@ -5860,7 +5860,7 @@ the configuration (without a prefix: ``Auto``).
* ``SBPO_NonEmptyParentheses`` (in configuration: ``NonEmptyParentheses``)
Put a space before opening parentheses only if the parentheses are not
- empty i.e. '()'
+ empty.
.. code-block:: c++
@@ -6245,7 +6245,7 @@ the configuration (without a prefix: ``Auto``).
true: false:
x = ( int32 )y vs. x = (int32)y
- * ``bool InEmptyParentheses`` Put a space in parentheses only if the parentheses are empty i.e. '()'
+ * ``bool InEmptyParentheses`` Insert a space in empty parentheses, i.e. ``()``.
.. code-block:: c++
@@ -6409,10 +6409,9 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
TableGenBreakInsideDAGArg: BreakAll
- TableGenBreakingDAGArgOperators: ['ins', 'outs']
-
+ TableGenBreakingDAGArgOperators: [ins, outs]
makes the line break only occurs inside DAGArgs beginning with the
- specified identifiers 'ins' and 'outs'.
+ specified identifiers ``ins`` and ``outs``.
.. code-block:: c++
@@ -6450,7 +6449,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- TypenameMacros: ['STACK_OF', 'LIST']
+ TypenameMacros: [STACK_OF, LIST]
For example: OpenSSL STACK_OF, BSD LIST_ENTRY.
@@ -6518,7 +6517,7 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: yaml
- WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
+ WhitespaceSensitiveMacros: [STRINGIZE, PP_STRINGIZE]
For example: BOOST_PP_STRINGIZE
diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h
index eb6647038403d..1e220ce0749b0 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -814,8 +814,8 @@ struct FormatStyle {
enum ShortFunctionStyle : int8_t {
/// Never merge functions into a single line.
SFS_None,
- /// Only merge functions defined inside a class. Same as "inline",
- /// except it does not implies "empty": i.e. top level empty functions
+ /// Only merge functions defined inside a class. Same as ``inline``,
+ /// except it does not implies ``empty``: i.e. top level empty functions
/// are not merged either.
/// \code
/// class Foo {
@@ -836,7 +836,7 @@ struct FormatStyle {
/// }
/// \endcode
SFS_Empty,
- /// Only merge functions defined inside a class. Implies "empty".
+ /// Only merge functions defined inside a class. Implies ``empty``.
/// \code
/// class Foo {
/// void f() { foo(); }
@@ -1167,7 +1167,7 @@ struct FormatStyle {
///
/// In the .clang-format configuration file, this can be configured like:
/// \code{.yaml}
- /// AttributeMacros: ['__capability', '__output', '__unused']
+ /// AttributeMacros: [__capability, __output, __unused]
/// \endcode
///
/// \version 12
@@ -2631,7 +2631,7 @@ struct FormatStyle {
///
/// In the .clang-format configuration file, this can be configured like:
/// \code{.yaml}
- /// ForEachMacros: ['RANGES_FOR', 'FOREACH']
+ /// ForEachMacros: [RANGES_FOR, FOREACH]
/// \endcode
///
/// For example: BOOST_FOREACH.
@@ -2653,7 +2653,7 @@ struct FormatStyle {
///
/// In the .clang-format configuration file, this can be configured like:
/// \code{.yaml}
- /// IfMacros: ['IF']
+ /// IfMacros: [IF]
/// \endcode
///
/// For example: `KJ_IF_MAYBE
@@ -3030,7 +3030,7 @@ struct FormatStyle {
/// in the following yaml example. This will result in imports being
/// formatted as in the Java example below.
/// \code{.yaml}
- /// JavaImportGroups: ['com.example', 'com', 'org']
+ /// JavaImportGroups: [com.example, com, org]
/// \endcode
///
/// \code{.java}
@@ -3086,7 +3086,7 @@ struct FormatStyle {
/// VeryLongImportsAreAnnoying,
/// VeryLongImportsAreAnnoying,
/// VeryLongImportsAreAnnoying,
- /// } from 'some/module.js'
+ /// } from "some/module.js"
///
/// false:
/// import {VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying, VeryLongImportsAreAnnoying,} from "some/module.js"
@@ -3615,7 +3615,7 @@ struct FormatStyle {
/// Change specifiers/qualifiers to be aligned based on ``QualifierOrder``.
/// With:
/// \code{.yaml}
- /// QualifierOrder: ['inline', 'static', 'type', 'const']
+ /// QualifierOrder: [inline, static, type, const]
/// \endcode
///
/// \code
@@ -3650,15 +3650,15 @@ struct FormatStyle {
/// * type
///
/// \note
- /// it MUST contain 'type'.
+ /// It \b must contain ``type``.
/// \endnote
///
- /// 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
+ /// 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
/// placed to the right of the type and aligned in the order supplied.
///
/// \code{.yaml}
- /// QualifierOrder: ['inline', 'static', 'type', 'const', 'volatile' ]
+ /// QualifierOrder: [inline, static, type, const, volatile]
/// \endcode
/// \version 14
std::vector<std::string> QualifierOrder;
@@ -3692,10 +3692,10 @@ struct FormatStyle {
/// name will be reformatted assuming the specified language based on the
/// style for that language defined in the .clang-format file. If no style has
/// been defined in the .clang-format file for the specific language, a
- /// predefined style given by 'BasedOnStyle' is used. If 'BasedOnStyle' is not
- /// found, the formatting is based on llvm style. A matching delimiter takes
- /// precedence over a matching enclosing function name for determining the
- /// language of the raw string contents.
+ /// predefined style given by ``BasedOnStyle`` is used. If ``BasedOnStyle`` is
+ /// not found, the formatting is based on ``LLVM`` style. A matching delimiter
+ /// takes precedence over a matching enclosing function name for determining
+ /// the language of the raw string contents.
///
/// If a canonical delimiter is specified, occurrences of other delimiters for
/// the same language will be updated to the canonical if possible.
@@ -3708,17 +3708,17 @@ struct FormatStyle {
/// RawStringFormats:
/// - Language: TextProto
/// Delimiters:
- /// - 'pb'
- /// - 'proto'
+ /// - pb
+ /// - proto
/// EnclosingFunctions:
- /// - 'PARSE_TEXT_PROTO'
+ /// - PARSE_TEXT_PROTO
/// BasedOnStyle: google
/// - Language: Cpp
/// Delimiters:
- /// - 'cc'
- /// - 'cpp'
- /// BasedOnStyle: llvm
- /// CanonicalDelimiter: 'cc'
+ /// - cc
+ /// - cpp
+ /// BasedOnStyle: LLVM
+ /// CanonicalDelimiter: cc
/// \endcode
/// \version 6
std::vector<RawStringFormat> RawStringFormats;
@@ -4046,7 +4046,7 @@ struct FormatStyle {
///
/// This determines the maximum length of short namespaces by counting
/// unwrapped lines (i.e. containing neither opening nor closing
- /// namespace brace) and makes "FixNamespaceComments" omit adding
+ /// namespace brace) and makes ``FixNamespaceComments`` omit adding
/// end comments for those.
/// \code
/// ShortNamespaceLines: 1 vs. ShortNamespaceLines: 0
@@ -4138,7 +4138,7 @@ struct FormatStyle {
/// \endcode
SUD_Never,
/// Using declarations are sorted in the order defined as follows:
- /// Split the strings by "::" and discard any initial empty strings. Sort
+ /// Split the strings by ``::`` and discard any initial empty strings. Sort
/// the lists of names lexicographically, and within those groups, names are
/// in case-insensitive lexicographic order.
/// \code
@@ -4150,7 +4150,7 @@ struct FormatStyle {
/// \endcode
SUD_Lexicographic,
/// Using declarations are sorted in the order defined as follows:
- /// Split the strings by "::" and discard any initial empty strings. The
+ /// Split the strings by ``::`` and discard any initial empty strings. The
/// last element of each list is a non-namespace name; all others are
/// namespace names. Sort the lists of names lexicographically, where the
/// sort order of individual names is that all non-namespace names come
@@ -4186,7 +4186,7 @@ struct FormatStyle {
/// \version 9
bool SpaceAfterLogicalNot;
- /// If \c true, a space will be inserted after the 'template' keyword.
+ /// If \c true, a space will be inserted after the ``template`` keyword.
/// \code
/// true: false:
/// template <int> void foo(); vs. template<int> void foo();
@@ -4316,7 +4316,7 @@ struct FormatStyle {
/// \endcode
SBPO_ControlStatementsExceptControlMacros,
/// Put a space before opening parentheses only if the parentheses are not
- /// empty i.e. '()'
+ /// empty.
/// \code
/// void() {
/// if (true) {
@@ -4668,7 +4668,7 @@ struct FormatStyle {
/// x = ( int32 )y vs. x = (int32)y
/// \endcode
bool InCStyleCasts;
- /// Put a space in parentheses only if the parentheses are empty i.e. '()'
+ /// Insert a space in empty parentheses, i.e. ``()``.
/// \code
/// true: false:
/// void f( ) { vs. void f() {
@@ -4804,11 +4804,10 @@ struct FormatStyle {
/// For example the configuration,
/// \code{.yaml}
/// TableGenBreakInsideDAGArg: BreakAll
- /// TableGenBreakingDAGArgOperators: ['ins', 'outs']
+ /// TableGenBreakingDAGArgOperators: [ins, outs]
/// \endcode
- ///
/// makes the line break only occurs inside DAGArgs beginning with the
- /// specified identifiers 'ins' and 'outs'.
+ /// specified identifiers ``ins`` and ``outs``.
///
/// \code
/// let DAGArgIns = (ins
@@ -4873,7 +4872,7 @@ struct FormatStyle {
///
/// In the .clang-format configuration file, this can be configured like:
/// \code{.yaml}
- /// TypenameMacros: ['STACK_OF', 'LIST']
+ /// TypenameMacros: [STACK_OF, LIST]
/// \endcode
///
/// For example: OpenSSL STACK_OF, BSD LIST_ENTRY.
@@ -4929,7 +4928,7 @@ struct FormatStyle {
///
/// In the .clang-format configuration file, this can be configured like:
/// \code{.yaml}
- /// WhitespaceSensitiveMacros: ['STRINGIZE', 'PP_STRINGIZE']
+ /// WhitespaceSensitiveMacros: [STRINGIZE, PP_STRINGIZE]
/// \endcode
///
/// For example: BOOST_PP_STRINGIZE
More information about the cfe-commits
mailing list