forked from grpc/grpc-swift
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftformat
60 lines (43 loc) · 1.73 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
# Language version.
--swiftversion 5.6
# Ignore generated files.
--exclude **/LinuxMain.swift,**/XCTestManifests.swift,**/*.grpc.swift,**/*.pb.swift
--exclude Sources/GRPCSampleData/GRPCSwiftCertificate.swift
--indent 2
--maxwidth 100
# Require explicit self
--self insert
# Only remove unused args in closures.
--stripunusedargs closure-only
# Wrap before the first argument (if wrapping is necessary).
--wraparguments before-first
# Don't indent #if blocks
--ifdef no-indent
# Don't turn Optional<Foo> into Foo?
--shortoptionals except-properties
# This rule doesn't always work as we'd expect: specifically when we return a
# succeeded future whose type is a closure then that closure is incorrectly
# treated as a trailing closure. This is relevant because the service provider
# API for client streaming RPCs has this exact shape.
--disable trailingClosures
# Don't wrap the opening brace of multiline statements.
--disable wrapMultilineStatementBraces
# We used to support 5.0 and return is redundant in more places in 5.1: enabling
# this rule creates a large (and unnecessary) diff.
--disable redundantReturn
# Don't prefer using key paths for trivial closures.
--disable preferKeyPath
# Put ACLs on declarations within an extension rather than the extension itself.
--extensionacl on-declarations
# Don't remove internal ACLs
--disable redundantInternal
# Don't remove redundant parenstheses, because no all of them are redundant.
--disable redundantParens
# Don't remove static Self
--disable redundantStaticSelf
# Hoisting try and await causes a bunch of issues (and churn) in 0.52.0. Disable
# them for the time being.
--disable hoistTry
--disable hoistAwait
# Disabled as enabling causes a lot of churn.
--disable wrapSingleLineComments