Skip to content

Commit

Permalink
[clang-format][NFC] Improve documentation on ReflowComments
Browse files Browse the repository at this point in the history
Fixes #58403

Differential Revision: https://reviews.llvm.org/D137865
  • Loading branch information
HazardyKnusperkeks committed Nov 16, 2022
1 parent 617277e commit 40c1476
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions clang/docs/ClangFormatStyleOptions.rst
Expand Up @@ -3795,7 +3795,9 @@ the configuration (without a prefix: ``Auto``).


**ReflowComments** (``Boolean``) :versionbadge:`clang-format 3.8`
If ``true``, clang-format will attempt to re-flow comments.
If ``true``, clang-format will attempt to re-flow comments. That is it
will touch a comment and *reflow* long comments into new lines, trying to
obey the ``ColumnLimit``.

.. code-block:: c++

Expand Down Expand Up @@ -4610,9 +4612,11 @@ the configuration (without a prefix: ``Auto``).
/// - Foo /// - Foo
/// - Bar /// - Bar

This option has only effect if ``ReflowComments`` is set to ``true``.

Nested configuration flags:

Control of spaces within a single line comment
Control of spaces within a single line comment.

* ``unsigned Minimum`` The minimum number of spaces at the start of the comment.

Expand Down
8 changes: 6 additions & 2 deletions clang/include/clang/Format/Format.h
Expand Up @@ -3070,7 +3070,9 @@ struct FormatStyle {
ReferenceAlignmentStyle ReferenceAlignment;

// clang-format off
/// If ``true``, clang-format will attempt to re-flow comments.
/// If ``true``, clang-format will attempt to re-flow comments. That is it
/// will touch a comment and *reflow* long comments into new lines, trying to
/// obey the ``ColumnLimit``.
/// \code
/// false:
/// // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
Expand Down Expand Up @@ -3821,7 +3823,7 @@ struct FormatStyle {
/// \version 3.7
bool SpacesInCStyleCastParentheses;

/// Control of spaces within a single line comment
/// Control of spaces within a single line comment.
struct SpacesInLineComment {
/// The minimum number of spaces at the start of the comment.
unsigned Minimum;
Expand Down Expand Up @@ -3858,6 +3860,8 @@ struct FormatStyle {
/// /// - Foo /// - Foo
/// /// - Bar /// - Bar
/// \endcode
///
/// This option has only effect if ``ReflowComments`` is set to ``true``.
/// \version 13
SpacesInLineComment SpacesInLineCommentPrefix;

Expand Down

0 comments on commit 40c1476

Please sign in to comment.