-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.swiftformat
More file actions
127 lines (122 loc) · 4.56 KB
/
Copy path.swiftformat
File metadata and controls
127 lines (122 loc) · 4.56 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File options
# Rules
## Enabled
--enable andOperator
--enable anyObjectProtocol
--enable applicationMain
--enable assertionFailures
--enable blankLinesBetweenScopes
--enable blockComments
--enable braces
--enable conditionalAssignment
--enable consecutiveBlankLines
--enable consecutiveSpaces
--enable duplicateImports
--enable elseOnSameLine
--enable emptyBraces
--enable extensionAccessControl
--enable fileHeader
--enable hoistAwait
--enable hoistPatternLet
--enable hoistTry
--enable initCoderUnavailable
--enable leadingDelimiters
--enable linebreakAtEndOfFile
--enable linebreaks
--enable modifierOrder
--enable opaqueGenericParameters
--enable preferKeyPath
--enable redundantBackticks
--enable redundantBreak
--enable redundantClosure
--enable redundantExtensionACL
--enable redundantFileprivate
--enable redundantGet
--enable redundantInit
--enable redundantInternal
--enable redundantLet
--enable redundantLetError
--enable redundantNilInit
--enable redundantObjc
--enable redundantOptionalBinding
--enable redundantParens
--enable redundantPattern
--enable redundantRawValues
--enable redundantReturn
--enable redundantSelf
--enable redundantStaticSelf
--enable redundantType
--enable redundantVoidReturnType
--enable semicolons
--enable sortImports
--enable sortTypealiases
--enable spaceAroundBraces
--enable spaceAroundBrackets
--enable spaceAroundComments
--enable spaceAroundGenerics
--enable spaceAroundOperators
--enable spaceAroundParens
--enable spaceInsideBraces
--enable spaceInsideBrackets
--enable spaceInsideComments
--enable spaceInsideGenerics
--enable spaceInsideParens
--enable strongifiedSelf
--enable strongOutlets
--enable todos
--enable trailingClosures
--enable trailingSpace
--enable typeSugar
--enable void
--enable wrapAttributes
--enable yodaConditions
## Disabled
--disable blankLinesAroundMark # -> Normally correct, but not for Comments after the MARK
--disable blankLinesAtEndOfScope # -> Disabled until it is possible to add 1 line for classes, structs & enums, but 0 for func etc. --> https://github.com/nicklockwood/SwiftFormat/issues/261
--disable blankLinesAtStartOfScope # -> Disabled until it is possible to add 1 line for classes, structs & enums, but 0 for func etc. --> https://github.com/nicklockwood/SwiftFormat/issues/261
--disable enumNamespaces # -> Caseless enums should be avoided in my opinion
--disable genericExtensions # -> Writing "where …" is more swifty and expressive than "<…>" in our opinion
--disable headerFileName # -> By using the fileHeader rule we already ensure that the filename in the header is correct
--disable indent # -> This destroys clarity in too many cases
--disable numberFormatting # -> When working on banking related projects we have different formatting for things like bank codes than we have on normal numbers. Those can't be automatically detected.
--disable sortDeclarations # -> Too much overhead having to write // swiftformat:sort in files
--disable trailingCommas # -> A comma after the last element of a collection is never necessary
--disable unusedArguments # -> This destroys some Protocol implementations (applicationDidLaunch etc.)
--disable wrap # -> We have a widescreen monitors for a reason
--disable wrapArguments # -> Normally I don't wrap arguments and if I do, it is decided on a case-by-case basis
--disable wrapMultilineStatementBraces # -> Objective-C is dying for many reasons ... and this is one of them!
--disable wrapSingleLineComments # -> We have a widescreen monitors for a reason
# Format options
--allman false
--closurevoid remove
--complexattrs prev-line # wrapAttributes
--computedvarattrs prev-line #warpAttributes
--elseposition same-line
--emptybraces spaced
--extensionacl on-extension
--funcattributes prev-line # wrapAttributes
--guardelse same-line
--header "\n📄 {file}\n👨🏼💻 Author: Benno Kress\n"
--ifdef indent
--importgrouping alpha
--indent 4
--indentcase false
--linebreaks lf
--modifierorder optional,required,convenience,override,indirect,private,fileprivate,internal,public,open,private(set),fileprivate(set),internal(set),public(set),final,dynamic,lazy,static,class,weak,unowned,mutating,nonmutating,prefix,postfix
--operatorfunc spaced
--patternlet hoist
--ranges spaced
--redundanttype inferred
--self init-only
--semicolons inline
--shortoptionals always
--smarttabs enabled
--storedvarattrs same-line #warpAttributes
--stripunusedargs always
--swiftversion 5.6
--tabwidth 4
--trimwhitespace always
--typeattributes prev-line # wrapAttributes
--voidtype void
--xcodeindentation disabled
--yodaswap always