-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). #96804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
4c6b2fb
48ed2cf
1c816f5
3b3c762
159281a
1d65304
e11767e
1b2c790
f72fe9f
39ccdc0
f92325a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5204,22 +5204,46 @@ the configuration (without a prefix: ``Auto``). | |
|
|
||
| .. _ReflowComments: | ||
|
|
||
| **ReflowComments** (``Boolean``) :versionbadge:`clang-format 3.8` :ref:`¶ <ReflowComments>` | ||
| 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``. | ||
| **ReflowComments** (``ReflowCommentsStyle``) :versionbadge:`clang-format 3.8` :ref:`¶ <ReflowComments>` | ||
| Comment reformatting style. | ||
|
|
||
| .. code-block:: c++ | ||
| Possible values: | ||
|
|
||
| * ``// clang-format on`` (in configuration: ``// clang-format on``) | ||
| Leave comments untouched. | ||
|
|
||
| .. code-block:: c++ | ||
|
|
||
| // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information | ||
| /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */ | ||
| /* third veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information | ||
| * and a misaligned second line */ | ||
|
|
||
| * ``// clang-format on`` (in configuration: ``// clang-format on``) | ||
ichaer marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Only apply indentation rules, moving comments left or right, without | ||
| changing formatting inside the comments. | ||
|
|
||
| .. code-block:: c++ | ||
|
|
||
| // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information | ||
| /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */ | ||
| /* third veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information | ||
| * and a misaligned second line */ | ||
|
|
||
| * ``// clang-format on`` (in configuration: ``// clang-format on``) | ||
| Apply indentation rules and re-flow long comments into new lines, trying | ||
|
||
| to obey the ``ColumnLimit``. | ||
|
|
||
| .. code-block:: c++ | ||
|
|
||
| // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of | ||
| // information | ||
| /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of | ||
| * information */ | ||
| /* third veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of | ||
| * information and a misaligned second line */ | ||
|
|
||
| false: | ||
| // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information | ||
| /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of information */ | ||
|
|
||
| true: | ||
| // veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of | ||
| // information | ||
| /* second veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongComment with plenty of | ||
| * information */ | ||
|
|
||
| .. _RemoveBracesLLVM: | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.