forked from mssun/passforios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftformat
300 lines (193 loc) · 7.58 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# SwiftFormat Configuration
## Excluded folders
--exclude \
Carthage, \
go, \
Pods
## Enabled rules
--rules \
acronyms, \
andOperator, \
anyObjectProtocol, \
assertionFailures, \
blankLinesAroundMark, \
blankLinesAtEndOfScope, \
blankLinesAtStartOfScope, \
# blankLinesBetweenImports, \
blankLinesBetweenScopes, \
blockComments, \
braces, \
consecutiveBlankLines, \
consecutiveSpaces, \
duplicateImports, \
elseOnSameLine, \
emptyBraces, \
enumNamespaces, \
extensionAccessControl, \
fileHeader, \
hoistPatternLet, \
indent, \
initCoderUnavailable, \
isEmpty, \
leadingDelimiters, \
linebreakAtEndOfFile, \
linebreaks, \
modifierOrder, \
# markTypes, \
numberFormatting, \
# organizeDeclarations, \
preferDouble, \
preferKeyPath, \
redundantBackticks, \
redundantBreak, \
redundantClosure, \
redundantExtensionACL, \
redundantFileprivate, \
redundantGet, \
redundantInit, \
redundantLet, \
redundantLetError, \
redundantNilInit, \
redundantObjc, \
redundantParens, \
redundantPattern, \
redundantRawValues, \
redundantReturn, \
redundantSelf, \
redundantType, \
redundantVoidReturnType, \
semicolons, \
sortedImports, \
sortedSwitchCases, \
spaceAroundBraces, \
spaceAroundBrackets, \
spaceAroundComments, \
spaceAroundGenerics, \
spaceAroundOperators, \
spaceAroundParens, \
spaceInsideBraces, \
spaceInsideBrackets, \
spaceInsideComments, \
spaceInsideGenerics, \
spaceInsideParens, \
# specifiers, \
strongOutlets, \
strongifiedSelf, \
todos, \
trailingClosures, \
trailingCommas, \
trailingSpace, \
typeSugar, \
unusedArguments, \
void, \
wrap, \
wrapArguments, \
wrapAttributes, \
wrapConditionalBodies, \
# wrapEnumCases, \
# wrapMultilineStatementBraces, \
# wrapSwitchCases, \
yodaConditions
## Formatting options
### Acronyms to auto-capitalize. Defaults to "ID,URL,UUID".
--acronyms "GPG, HTTP, HTTPS, ID, PGP, SSH, URI, URL, UUID"
### Use allman indentation style: "true" or "false" (default)
--allman false
### Color/image literal width. "actual-width" or "visual-width"
--assetliterals visual-width
### Binary grouping,threshold (default: 4,8) or "none", "ignore"
--binarygrouping 4,8
### Closing paren position: "balanced" (default) or "same-line"
--closingparen balanced
### Commas in collection literals: "always" (default) or "inline"
--commas always
### Decimal grouping,threshold (default: 3,6) or "none", "ignore"
--decimalgrouping 3,6
### Placement of else/catch: "same-line" (default) or "next-line"
--elseposition same-line
### Empty braces: "no-space" (default), "spaced" or "linebreak"
--emptybraces no-space
### Case of 'e' in numbers: "lowercase" or "uppercase" (default)
--exponentcase lowercase
### Group exponent digits: "enabled" or "disabled" (default)
--exponentgrouping disabled
### Place ACL "on-extension" (default) or "on-declarations"
--extensionacl on-extension
### Group digits after '.': "enabled" or "disabled" (default)
--fractiongrouping disabled
### Function @attributes: "preserve", "prev-line", or "same-line"
--funcattributes prev-line
### Guard else: "same-line", "next-line" or "auto" (default)
--guardelse auto
### Header comments: "strip", "ignore", or the text you wish use
--header ignore
### Hex grouping,threshold (default: 4,8) or "none", "ignore"
--hexgrouping 4,8
### Casing for hex literals: "uppercase" (default) or "lowercase"
--hexliteralcase uppercase
### #if indenting: "indent" (default), "no-indent" or "outdent"
--ifdef indent
### "testable-first", "testable-last", "alpha" (default) or "length"
--importgrouping testable-last
### Number of spaces to indent, or "tab" to use tabs
--indent 4
### Indent cases inside a switch: "true" or "false" (default)
--indentcase false
### Linebreak character to use: "cr", "crlf" or "lf" (default)
--linebreaks lf
### Maximum length of a line before wrapping. defaults to "none"
--maxwidth none
### Comma-delimited list of modifiers in preferred order
--modifierorder
### Comma-delimited list of operators without surrounding space
--nospaceoperators
### Comma-delimited list of operators that shouldn't be wrapped
--nowrapoperators
### Octal grouping,threshold (default: 4,8) or "none", "ignore"
--octalgrouping 4,8
### Spacing for operator funcs: "spaced" (default) or "no-space"
--operatorfunc spaced
### let/var placement in patterns: "hoist" (default) or "inline"
--patternlet hoist
### Explicit self: "insert", "remove" (default) or "init-only"
--self init-only
### Comma-delimited list of functions with @autoclosure arguments
--selfrequired
### Allow semicolons: "never" or "inline" (default)
--semicolons inline
### Use ? for Optionals "always" (default) or "except-properties"
--shortoptionals always
### Align code independently of tab width. defaults to "enabled"
--smarttabs enabled
### "closure-only", "unnamed-only" or "always" (default)
--stripunusedargs always
### The width of a tab character. Defaults to "unspecified"
--tabwidth 4
### Comma-delimited list of functions that use trailing closures
--trailingclosures
### Trim trailing space: "always" (default) or "nonblank-lines"
--trimwhitespace always
### Type @attributes: "preserve", "prev-line", or "same-line"
--typeattributes preserve
### Property @attributes: "preserve", "prev-line", or "same-line"
--varattributes same-line
### How Void types are represented: "void" (default) or "tuple"
--voidtype void
### Wrap all arguments: "before-first", "after-first", "preserve"
--wraparguments preserve
### Wrap array/dict: "before-first", "after-first", "preserve"
--wrapcollections preserve
### Wrap conditions: "before-first", "after-first", "preserve"
--wrapconditions preserve
### Wrap func params: "before-first", "after-first", "preserve"
--wrapparameters preserve
### Wrap return type: "if-multiline", "preserve" (default)
--wrapreturntype preserve
### Wrap ternary operators: "default", "before-operators"
--wrapternary before-operators
### Wrap typealiases: "before-first", "after-first", "preserve"
--wraptypealiases preserve
### Xcode indent guard/enum: "enabled" or "disabled" (default)
--xcodeindentation disabled
### Swap yoda values: "always" (default) or "literals-only"
--yodaswap always