[PATCH] D137865: [clang-format][NFC] Improve documentation on ReflowComments
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 11 13:27:23 PST 2022
HazardyKnusperkeks created this revision.
HazardyKnusperkeks added reviewers: rymiel, MyDeveloperDay, owenpan, curdeius.
HazardyKnusperkeks added a project: clang-format.
Herald added a project: All.
HazardyKnusperkeks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes https://github.com/llvm/llvm-project/issues/58403
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D137865
Files:
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -3070,7 +3070,10 @@
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``. ``/*`` comments will get a leading ``*`` on the
+ /// new lines.
/// \code
/// false:
/// // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information
@@ -3821,7 +3824,7 @@
/// \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;
@@ -3858,6 +3861,7 @@
/// /// - Foo /// - Foo
/// /// - Bar /// - Bar
/// \endcode
+ /// This option has only effect if ``ReflowComments`` is set to ``true``.
/// \version 13
SpacesInLineComment SpacesInLineCommentPrefix;
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3795,7 +3795,10 @@
**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``. ``/*`` comments will get a leading ``*`` on the
+ new lines.
.. code-block:: c++
@@ -4609,10 +4612,11 @@
/// List: ///List:
/// - 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137865.474847.patch
Type: text/x-patch
Size: 2480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221111/87a693d2/attachment-0001.bin>
More information about the cfe-commits
mailing list