summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-09-22 12:00:34 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-09-22 12:00:34 +0000
commit917053476805b535d160b1244771653d041571a8 (patch)
treea475c2a0250723a7aef143c4354a076ea0da43d3 /docs
parent18524e1862e9a81b4bc146d1560ecff1b5f41001 (diff)
downloadclang-917053476805b535d160b1244771653d041571a8.tar.gz
Clang-format: Add Whitesmiths indentation style
Summary: This patch adds support for the Whitesmiths indentation style to clang-format. It’s an update to a patch submitted in 2015 (D6833), but reworks it to use the newer API. There are still some issues with this patch, primarily around `switch` and `case` support. The added unit test won’t currently pass because of the remaining issues. Reviewers: mboehme, MyDeveloperDay, djasper Reviewed By: MyDeveloperDay Subscribers: krasimir, MyDeveloperDay, echristo, cfe-commits Patch By: @timwoj (Tim Wojtulewicz) Tags: #clang Differential Revision: https://reviews.llvm.org/D67627 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/ClangFormatStyleOptions.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst
index 7193e3ede2..6a42da71b9 100644
--- a/docs/ClangFormatStyleOptions.rst
+++ b/docs/ClangFormatStyleOptions.rst
@@ -1128,6 +1128,34 @@ the configuration (without a prefix: ``Auto``).
B
};
+ * ``BS_Whitesmiths`` (in configuration: ``Whitesmiths``)
+ Like ``Allman`` but always indent braces and line up code with braces.
+
+ .. code-block:: c++
+
+ try
+ {
+ foo();
+ }
+ catch ()
+ {
+ }
+ void foo() { bar(); }
+ class foo
+ {
+ };
+ if (foo())
+ {
+ }
+ else
+ {
+ }
+ enum X : int
+ {
+ A,
+ B
+ };
+
* ``BS_GNU`` (in configuration: ``GNU``)
Always break before braces and add an extra level of indentation to
braces of control statements, not to those of class, function