summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-14 09:33:35 +0000
committerDaniel Jasper <djasper@google.com>2014-05-14 09:33:35 +0000
commit65e68675f101657b69a404432c2116bc9cc23b22 (patch)
treed195a811e39bdf8b7d16872e7b9a6358df471406 /docs
parent0c715604f457545f279c4602d895520e082c3f0a (diff)
downloadclang-65e68675f101657b69a404432c2116bc9cc23b22.tar.gz
clang-65e68675f101657b69a404432c2116bc9cc23b22.tar.bz2
clang-65e68675f101657b69a404432c2116bc9cc23b22.tar.xz
clang-format: Add option to allow short blocks on a single line.
With AllowShortBlocksOnASingleLine, clang-format allows: if (a) { return; } Based on patch by Gonzalo BG, thank you! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/ClangFormatStyleOptions.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst
index 27d5e7426a..b2157dd832 100644
--- a/docs/ClangFormatStyleOptions.rst
+++ b/docs/ClangFormatStyleOptions.rst
@@ -106,6 +106,11 @@ the configuration (without a prefix: ``Auto``).
Allow putting all parameters of a function declaration onto
the next line even if ``BinPackParameters`` is ``false``.
+**AllowShortBlocksOnASingleLine** (``bool``)
+ Allows contracting simple braced statements to a single line.
+
+ E.g., this allows ``if (a) { return; }`` to be put on a single line.
+
**AllowShortFunctionsOnASingleLine** (``ShortFunctionStyle``)
Dependent on the value, ``int f() { return 0; }`` can be put
on a single line.
@@ -284,7 +289,7 @@ the configuration (without a prefix: ``Auto``).
**ObjCSpaceAfterProperty** (``bool``)
Add a space after ``@property`` in Objective-C, i.e. use
- ``@property (readonly)`` instead of ``@property(readonly)``.
+ ``\@property (readonly)`` instead of ``\@property(readonly)``.
**ObjCSpaceBeforeProtocolList** (``bool``)
Add a space in front of an Objective-C protocol list, i.e. use
@@ -338,7 +343,7 @@ the configuration (without a prefix: ``Auto``).
**SpacesBeforeTrailingComments** (``unsigned``)
The number of spaces before trailing line comments (//-comments).
- This does not affect trailing block comments (/\*\*/-comments) as those
+ This does not affect trailing block comments (/**/-comments) as those
commonly have different usage patterns and a number of special cases.
**SpacesInAngles** (``bool``)