summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-14 21:47:25 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-17 08:27:43 (GMT)
commit603c639030c3d0582dcd499fa3ee95f2a26885d2 (patch)
tree59201b42c88fac508c9dd15fdd540cbd393d5146
parentf7de41c770be1bc6c45e825ff0fbdd6bfb799fae (diff)
downloadswift-603c639030c3d0582dcd499fa3ee95f2a26885d2.zip
swift-603c639030c3d0582dcd499fa3ee95f2a26885d2.tar.bz2
Add .clang-format configuration file for Swift projects
Test-Information: Applied it on 50 random source and header files. The result looked pretty much like the style we currently use. Change-Id: I23806261a22330acfcbb8f197f76d35227e32d6d
-rw-r--r--.clang-format39
1 files changed, 39 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..8c8601e
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,39 @@
+---
+Language: Cpp
+UseTab: Never
+TabWidth: 2
+Standard: Cpp11
+ConstructorInitializerIndentWidth: 2
+ContinuationIndentWidth: 2
+IndentWidth: 2
+PointerAlignment: Left
+ReflowComments: false
+# clang-format does not correctly detect corresponding header files at the moment.
+# Use BuildTools/FixIncludes.py for now. Enable this when it does.
+SortIncludes: false
+AccessModifierOffset: -2
+NamespaceIndentation: All
+# A ultra high column limit is required as a column limit of 0 does not work as documented.
+ColumnLimit: 900
+AllowShortBlocksOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortLoopsOnASingleLine: false
+IndentCaseLabels: true
+BreakBeforeBraces: Custom
+BraceWrapping:
+ AfterClass: false
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: false
+ AfterNamespace: false
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ BeforeCatch: true
+ BeforeElse: true
+ IndentBraces: false
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+BreakConstructorInitializersBeforeComma: false
+AlignAfterOpenBracket: Align
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+AlwaysBreakTemplateDeclarations: true \ No newline at end of file