Skip to content
Snippets Groups Projects
Commit 0fcd9e94 authored by Alexander Kornienko's avatar Alexander Kornienko
Browse files

Update clang-format options docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261643 91177308-0d34-0410-b5e6-96231b3b80d8
parent df679caa
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ the configuration (without a prefix: ``Auto``). ...@@ -154,7 +154,7 @@ the configuration (without a prefix: ``Auto``).
If ``true``, horizontally aligns arguments after an open bracket. If ``true``, horizontally aligns arguments after an open bracket.
This applies to round brackets (parentheses), angle brackets and square This applies to round brackets (parentheses), angle brackets and square
brackets. This will result in formattings like brackets.
Possible values: Possible values:
...@@ -214,6 +214,14 @@ the configuration (without a prefix: ``Auto``). ...@@ -214,6 +214,14 @@ the configuration (without a prefix: ``Auto``).
If ``true``, horizontally align operands of binary and ternary If ``true``, horizontally align operands of binary and ternary
expressions. expressions.
Specifically, this aligns operands of a single expression that needs to be
split over multiple lines, e.g.:
.. code-block:: c++
int aaa = bbbbbbbbbbbbbbb +
ccccccccccccccc;
**AlignTrailingComments** (``bool``) **AlignTrailingComments** (``bool``)
If ``true``, aligns trailing comments. If ``true``, aligns trailing comments.
...@@ -377,6 +385,9 @@ the configuration (without a prefix: ``Auto``). ...@@ -377,6 +385,9 @@ the configuration (without a prefix: ``Auto``).
Always break constructor initializers before commas and align Always break constructor initializers before commas and align
the commas with the colon. the commas with the colon.
**BreakStringLiterals** (``bool``)
Allow breaking string literals when formatting.
**ColumnLimit** (``unsigned``) **ColumnLimit** (``unsigned``)
The column limit. The column limit.
...@@ -462,10 +473,12 @@ the configuration (without a prefix: ``Auto``). ...@@ -462,10 +473,12 @@ the configuration (without a prefix: ``Auto``).
according to increasing category number and then alphabetically within according to increasing category number and then alphabetically within
each category. each category.
If none of the regular expressions match, UINT_MAX is assigned as If none of the regular expressions match, INT_MAX is assigned as
category. The main header for a source file automatically gets category 0, category. The main header for a source file automatically gets category 0.
so that it is kept at the beginning of the #includes so that it is generally kept at the beginning of the #includes
(http://llvm.org/docs/CodingStandards.html#include-style). (http://llvm.org/docs/CodingStandards.html#include-style). However, you
can also assign negative priorities if you have certain headers that
always need to be first.
To configure this in the .clang-format file, use: To configure this in the .clang-format file, use:
...@@ -511,6 +524,8 @@ the configuration (without a prefix: ``Auto``). ...@@ -511,6 +524,8 @@ the configuration (without a prefix: ``Auto``).
* ``LK_Proto`` (in configuration: ``Proto``) * ``LK_Proto`` (in configuration: ``Proto``)
Should be used for Protocol Buffers Should be used for Protocol Buffers
(https://developers.google.com/protocol-buffers/). (https://developers.google.com/protocol-buffers/).
* ``LK_TableGen`` (in configuration: ``TableGen``)
Should be used for TableGen code.
**MacroBlockBegin** (``std::string``) **MacroBlockBegin** (``std::string``)
...@@ -578,6 +593,12 @@ the configuration (without a prefix: ``Auto``). ...@@ -578,6 +593,12 @@ the configuration (without a prefix: ``Auto``).
Align pointer in the middle. Align pointer in the middle.
**ReflowComments** (``bool``)
If true, clang-format will attempt to re-flow comments.
**SortIncludes** (``bool``)
If true, clang-format will sort #includes.
**SpaceAfterCStyleCast** (``bool``) **SpaceAfterCStyleCast** (``bool``)
If ``true``, a space may be inserted after C style casts. If ``true``, a space may be inserted after C style casts.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment