-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftformat
59 lines (48 loc) · 1.31 KB
/
.swiftformat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md
--disable all
# force using self
--self "insert"
--enable redundantSelf
--enable andOperator,anyObjectProtocol,assertionFailures
# blank lines around scope
--enable blankLinesAtEndOfScope,blankLinesAtStartOfScope,blankLinesBetweenScopes
# redundant blank lines
--enable consecutiveBlankLines,blankLinesBetweenImports
--trimwhitespace always
--enable trailingSpace
# format if statements
--allman "false"
--enable braces
--elseposition "same-line"
--guardelse "same-line"
--enable elseOnSameLine
--enable leadingDelimiters
--enable redundantParens
#duplicated spaces
--enable consecutiveSpaces
--enable spaceAroundBrackets
--enable spaceAroundGenerics,spaceInsideGenerics
--operatorfunc spaced
--ranges no-space
--enable spaceAroundOperators
--enable spaceAroundComments,spaceInsideComments
--enable spaceAroundParens,spaceInsideParens
--enable spaceInsideBraces,spaceInsideBrackets
# redundant error in catch
--enable redundantLetError
#indentation
--indent 4
--smarttabs enabled
--indentcase false
--ifdef no-indent
--xcodeindentation disabled
--indentstrings false
--enable indent
--enable yodaConditions
#common mistakes
--enable duplicateImports,redundantBreak,redundantLet
#other
--enable redundantNilInit
--enable todos
--commas inline
--enable trailingCommas