Skip to content

Commit

Permalink
[clang-format][doc] Replace single back quotes with double ones
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed Jul 19, 2023
1 parent 4ae87b3 commit 8f54b83
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 54 deletions.
52 changes: 27 additions & 25 deletions clang/docs/ClangFormatStyleOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ the configuration (without a prefix: ``Auto``).
.. note::

@autoreleasepool and @synchronized blocks are wrapped
according to `AfterControlStatement` flag.
according to ``AfterControlStatement`` flag.

* ``bool AfterStruct`` Wrap struct definitions.

Expand Down Expand Up @@ -1803,9 +1803,10 @@ the configuration (without a prefix: ``Auto``).

* ``bool SplitEmptyFunction`` If ``false``, empty function body can be put on a single line.
This option is used only if the opening brace of the function has
already been wrapped, i.e. the `AfterFunction` brace wrapping mode is
already been wrapped, i.e. the ``AfterFunction`` brace wrapping mode is
set, and the function could/should not be put on a single line (as per
`AllowShortFunctionsOnASingleLine` and constructor formatting options).
``AllowShortFunctionsOnASingleLine`` and constructor formatting
options).

.. code-block:: c++

Expand All @@ -1816,7 +1817,7 @@ the configuration (without a prefix: ``Auto``).

* ``bool SplitEmptyRecord`` If ``false``, empty record (e.g. class, struct or union) body
can be put on a single line. This option is used only if the opening
brace of the record has already been wrapped, i.e. the `AfterClass`
brace of the record has already been wrapped, i.e. the ``AfterClass``
(for classes) brace wrapping mode is set.

.. code-block:: c++
Expand All @@ -1828,7 +1829,7 @@ the configuration (without a prefix: ``Auto``).

* ``bool SplitEmptyNamespace`` If ``false``, empty namespace body can be put on a single line.
This option is used only if the opening brace of the namespace has
already been wrapped, i.e. the `AfterNamespace` brace wrapping mode is
already been wrapped, i.e. the ``AfterNamespace`` brace wrapping mode is
set.

.. code-block:: c++
Expand Down Expand Up @@ -1926,9 +1927,9 @@ the configuration (without a prefix: ``Auto``).
.. _BreakArrays:

**BreakArrays** (``Boolean``) :versionbadge:`clang-format 16` :ref:`<BreakArrays>`
If ``true``, clang-format will always break after a Json array `[`
otherwise it will scan until the closing `]` to determine if it should add
newlines between elements (prettier compatible).
If ``true``, clang-format will always break after a Json array ``[``
otherwise it will scan until the closing ``]`` to determine if it should
add newlines between elements (prettier compatible).


.. note::
Expand Down Expand Up @@ -2445,7 +2446,7 @@ the configuration (without a prefix: ``Auto``).
} // namespace N

* ``BS_Custom`` (in configuration: ``Custom``)
Configure each individual brace in `BraceWrapping`.
Configure each individual brace in ``BraceWrapping``.



Expand Down Expand Up @@ -3336,9 +3337,9 @@ the configuration (without a prefix: ``Auto``).

.. warning::

Setting this option to `true` could lead to incorrect code formatting due
to clang-format's lack of complete semantic information. As such, extra
care should be taken to review code changes made by this option.
Setting this option to ``true`` could lead to incorrect code formatting
due to clang-format's lack of complete semantic information. As such,
extra care should be taken to review code changes made by this option.

.. code-block:: c++

Expand Down Expand Up @@ -3746,7 +3747,7 @@ the configuration (without a prefix: ``Auto``).
A(a*b);

will usually be interpreted as a call to a function A, and the
multiplication expression will be formatted as `a * b`.
multiplication expression will be formatted as ``a * b``.

If we specify the macro definition:

Expand All @@ -3756,7 +3757,7 @@ the configuration (without a prefix: ``Auto``).
- A(x)=x
the code will now be parsed as a declaration of the variable b of type a*,
and formatted as `a* b` (depending on pointer-binding rules).
and formatted as ``a* b`` (depending on pointer-binding rules).

Features and restrictions:
* Both function-like macros and object-like macros are supported.
Expand Down Expand Up @@ -4127,7 +4128,7 @@ the configuration (without a prefix: ``Auto``).

.. warning::

Setting ``QualifierAlignment`` to something other than `Leave`, COULD
Setting ``QualifierAlignment`` to something other than ``Leave``, COULD
lead to incorrect code formatting due to incorrect decisions made due to
clang-formats lack of complete semantic information.
As such extra care should be taken to review code changes made by the use
Expand Down Expand Up @@ -4311,9 +4312,9 @@ the configuration (without a prefix: ``Auto``).

.. warning::

Setting this option to `true` could lead to incorrect code formatting due
to clang-format's lack of complete semantic information. As such, extra
care should be taken to review code changes made by this option.
Setting this option to ``true`` could lead to incorrect code formatting
due to clang-format's lack of complete semantic information. As such,
extra care should be taken to review code changes made by this option.

.. code-block:: c++

Expand Down Expand Up @@ -4408,9 +4409,9 @@ the configuration (without a prefix: ``Auto``).

.. warning::

Setting this option to `true` could lead to incorrect code formatting due
to clang-format's lack of complete semantic information. As such, extra
care should be taken to review code changes made by this option.
Setting this option to ``true`` could lead to incorrect code formatting
due to clang-format's lack of complete semantic information. As such,
extra care should be taken to review code changes made by this option.

.. code-block:: c++

Expand Down Expand Up @@ -4528,7 +4529,7 @@ the configuration (without a prefix: ``Auto``).
}

* ``REI_Keyword`` (in configuration: ``Keyword``)
Align requires expression body relative to the `requires` keyword.
Align requires expression body relative to the ``requires`` keyword.

.. code-block:: c++

Expand Down Expand Up @@ -4965,7 +4966,7 @@ the configuration (without a prefix: ``Auto``).

* ``SBPO_Custom`` (in configuration: ``Custom``)
Configure each individual space before parentheses in
`SpaceBeforeParensOptions`.
``SpaceBeforeParensOptions``.



Expand Down Expand Up @@ -5361,8 +5362,9 @@ the configuration (without a prefix: ``Auto``).
A vector of non-keyword identifiers that should be interpreted as type
names.

A `*`, `&`, or `&&` between a type name and another non-keyword identifier
is annotated as a pointer or reference token instead of a binary operator.
A ``*``, ``&``, or ``&&`` between a type name and another non-keyword
identifier is annotated as a pointer or reference token instead of a
binary operator.

.. _TypenameMacros:

Expand Down
60 changes: 31 additions & 29 deletions clang/include/clang/Format/Format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ struct FormatStyle {
/// Wrap ObjC definitions (interfaces, implementations...).
/// \note
/// @autoreleasepool and @synchronized blocks are wrapped
/// according to `AfterControlStatement` flag.
/// according to ``AfterControlStatement`` flag.
/// \endnote
bool AfterObjCDeclaration;
/// Wrap struct definitions.
Expand Down Expand Up @@ -1210,9 +1210,10 @@ struct FormatStyle {
bool IndentBraces;
/// If ``false``, empty function body can be put on a single line.
/// This option is used only if the opening brace of the function has
/// already been wrapped, i.e. the `AfterFunction` brace wrapping mode is
/// already been wrapped, i.e. the ``AfterFunction`` brace wrapping mode is
/// set, and the function could/should not be put on a single line (as per
/// `AllowShortFunctionsOnASingleLine` and constructor formatting options).
/// ``AllowShortFunctionsOnASingleLine`` and constructor formatting
/// options).
/// \code
/// false: true:
/// int f() vs. int f()
Expand All @@ -1223,7 +1224,7 @@ struct FormatStyle {
bool SplitEmptyFunction;
/// If ``false``, empty record (e.g. class, struct or union) body
/// can be put on a single line. This option is used only if the opening
/// brace of the record has already been wrapped, i.e. the `AfterClass`
/// brace of the record has already been wrapped, i.e. the ``AfterClass``
/// (for classes) brace wrapping mode is set.
/// \code
/// false: true:
Expand All @@ -1235,7 +1236,7 @@ struct FormatStyle {
bool SplitEmptyRecord;
/// If ``false``, empty namespace body can be put on a single line.
/// This option is used only if the opening brace of the namespace has
/// already been wrapped, i.e. the `AfterNamespace` brace wrapping mode is
/// already been wrapped, i.e. the ``AfterNamespace`` brace wrapping mode is
/// set.
/// \code
/// false: true:
Expand Down Expand Up @@ -1292,9 +1293,9 @@ struct FormatStyle {
/// \version 16
AttributeBreakingStyle BreakAfterAttributes;

/// If ``true``, clang-format will always break after a Json array `[`
/// otherwise it will scan until the closing `]` to determine if it should add
/// newlines between elements (prettier compatible).
/// If ``true``, clang-format will always break after a Json array ``[``
/// otherwise it will scan until the closing ``]`` to determine if it should
/// add newlines between elements (prettier compatible).
///
/// \note
/// This is currently only for formatting JSON.
Expand Down Expand Up @@ -1793,7 +1794,7 @@ struct FormatStyle {
/// } // namespace N
/// \endcode
BS_WebKit,
/// Configure each individual brace in `BraceWrapping`.
/// Configure each individual brace in ``BraceWrapping``.
BS_Custom
};

Expand Down Expand Up @@ -2467,9 +2468,9 @@ struct FormatStyle {
/// and ``while``) in C++ unless the control statements are inside macro
/// definitions or the braces would enclose preprocessor directives.
/// \warning
/// Setting this option to `true` could lead to incorrect code formatting due
/// to clang-format's lack of complete semantic information. As such, extra
/// care should be taken to review code changes made by this option.
/// Setting this option to ``true`` could lead to incorrect code formatting
/// due to clang-format's lack of complete semantic information. As such,
/// extra care should be taken to review code changes made by this option.
/// \endwarning
/// \code
/// false: true:
Expand Down Expand Up @@ -2839,7 +2840,7 @@ struct FormatStyle {
/// \endcode
///
/// will usually be interpreted as a call to a function A, and the
/// multiplication expression will be formatted as `a * b`.
/// multiplication expression will be formatted as ``a * b``.
///
/// If we specify the macro definition:
/// \code{.yaml}
Expand All @@ -2848,7 +2849,7 @@ struct FormatStyle {
/// \endcode
///
/// the code will now be parsed as a declaration of the variable b of type a*,
/// and formatted as `a* b` (depending on pointer-binding rules).
/// and formatted as ``a* b`` (depending on pointer-binding rules).
///
/// Features and restrictions:
/// * Both function-like macros and object-like macros are supported.
Expand Down Expand Up @@ -3189,7 +3190,7 @@ struct FormatStyle {

/// Different ways to arrange specifiers and qualifiers (e.g. const/volatile).
/// \warning
/// Setting ``QualifierAlignment`` to something other than `Leave`, COULD
/// Setting ``QualifierAlignment`` to something other than ``Leave``, COULD
/// lead to incorrect code formatting due to incorrect decisions made due to
/// clang-formats lack of complete semantic information.
/// As such extra care should be taken to review code changes made by the use
Expand Down Expand Up @@ -3335,9 +3336,9 @@ struct FormatStyle {
/// This option will be renamed and expanded to support other styles.
/// \endwarning
/// \warning
/// Setting this option to `true` could lead to incorrect code formatting due
/// to clang-format's lack of complete semantic information. As such, extra
/// care should be taken to review code changes made by this option.
/// Setting this option to ``true`` could lead to incorrect code formatting
/// due to clang-format's lack of complete semantic information. As such,
/// extra care should be taken to review code changes made by this option.
/// \endwarning
/// \code
/// false: true:
Expand Down Expand Up @@ -3421,9 +3422,9 @@ struct FormatStyle {

/// Remove semicolons after the closing brace of a non-empty function.
/// \warning
/// Setting this option to `true` could lead to incorrect code formatting due
/// to clang-format's lack of complete semantic information. As such, extra
/// care should be taken to review code changes made by this option.
/// Setting this option to ``true`` could lead to incorrect code formatting
/// due to clang-format's lack of complete semantic information. As such,
/// extra care should be taken to review code changes made by this option.
/// \endwarning
/// \code
/// false: true:
Expand Down Expand Up @@ -3529,7 +3530,7 @@ struct FormatStyle {
/// }
/// \endcode
REI_OuterScope,
/// Align requires expression body relative to the `requires` keyword.
/// Align requires expression body relative to the ``requires`` keyword.
/// \code
/// template <typename T>
/// concept C = requires(T t) {
Expand Down Expand Up @@ -3900,7 +3901,7 @@ struct FormatStyle {
/// \endcode
SBPO_Always,
/// Configure each individual space before parentheses in
/// `SpaceBeforeParensOptions`.
/// ``SpaceBeforeParensOptions``.
SBPO_Custom,
};

Expand Down Expand Up @@ -4085,7 +4086,7 @@ struct FormatStyle {
/// \version 3.7
unsigned SpacesBeforeTrailingComments;

/// Styles for adding spacing after ``<`` and before ``>`
/// Styles for adding spacing after ``<`` and before ``>``
/// in template argument lists.
enum SpacesInAnglesStyle : int8_t {
/// Remove spaces after ``<`` and before ``>``.
Expand Down Expand Up @@ -4268,8 +4269,9 @@ struct FormatStyle {
/// A vector of non-keyword identifiers that should be interpreted as type
/// names.
///
/// A `*`, `&`, or `&&` between a type name and another non-keyword identifier
/// is annotated as a pointer or reference token instead of a binary operator.
/// A ``*``, ``&``, or ``&&`` between a type name and another non-keyword
/// identifier is annotated as a pointer or reference token instead of a
/// binary operator.
///
/// \version 17
std::vector<std::string> TypeNames;
Expand Down Expand Up @@ -4647,7 +4649,7 @@ formatReplacements(StringRef Code, const tooling::Replacements &Replaces,
/// - 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
/// The include manipulation is done via ``tooling::HeaderInclude``, see its
/// documentation for more details on how include insertion points are found and
/// what edits are produced.
llvm::Expected<tooling::Replacements>
Expand Down Expand Up @@ -4738,11 +4740,11 @@ LangOptions getFormattingLangOpts(const FormatStyle &Style = getLLVMStyle());
extern const char *StyleOptionHelpDescription;

/// The suggested format style to use by default. This allows tools using
/// `getStyle` to have a consistent default style.
/// ``getStyle`` to have a consistent default style.
/// Different builds can modify the value to the preferred styles.
extern const char *DefaultFormatStyle;

/// The suggested predefined style to use as the fallback style in `getStyle`.
/// The suggested predefined style to use as the fallback style in ``getStyle``.
/// Different builds can modify the value to the preferred styles.
extern const char *DefaultFallbackStyle;

Expand Down

0 comments on commit 8f54b83

Please sign in to comment.