This applies to round brackets (parentheses), angle brackets and square
brackets. This will result in formattings like
+
.. code-block:: c++
someLongFunction(argument1,
argument2);
This will align the assignment operators of consecutive lines. This
will result in formattings like
+
.. code-block:: c++
int aaaa = 12;
int b = 23;
This will align the declaration names of consecutive lines. This
will result in formattings like
+
.. code-block:: c++
int aaaa = 12;
float b = 23;
instead of as function calls.
These are expected to be macros of the form:
+
.. code-block:: c++
FOREACH(<variable-declaration>, ...)
<loop-body>
In the .clang-format configuration file, this can be configured like:
+
.. code-block:: c++
ForEachMacros: ['RANGES_FOR', 'FOREACH']
(http://llvm.org/docs/CodingStandards.html#include-style).
To configure this in the .clang-format file, use:
+
.. code-block:: c++
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
def clean_comment_line(line):
if line == '/// \\code':
- return '.. code-block:: c++\n'
+ return '\n.. code-block:: c++\n'
if line == '/// \\endcode':
return ''
return line[4:] + '\n'