forked from jamesrochabrun/SwiftOpenAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.swiftformat
More file actions
134 lines (130 loc) · 4.39 KB
/
rules.swiftformat
File metadata and controls
134 lines (130 loc) · 4.39 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
128
129
130
131
132
133
134
# copied from https://github.com/airbnb/swift/blob/master/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat
# Exclude checkout directories for common package managers
--exclude Carthage,Pods,.build
# options
--swiftversion 6.0
--languagemode 5
--self remove # redundantSelf
--importgrouping testable-bottom # sortedImports
--commas always # trailingCommas
--trimwhitespace always # trailingSpace
--indent 2 #indent
--ifdef no-indent #indent
--indentstrings true #indent
--wraparguments before-first # wrapArguments
--wrapparameters before-first # wrapArguments
--wrapcollections before-first # wrapArguments
--wrapconditions before-first # wrapArguments
--wrapreturntype if-multiline #wrapArguments
--wrapeffects if-multiline #wrapArguments
--closingparen same-line # wrapArguments
--wraptypealiases before-first # wrapArguments
--funcattributes prev-line # wrapAttributes
--computedvarattrs prev-line # wrapAttributes
--storedvarattrs same-line # wrapAttributes
--complexattrs prev-line # wrapAttributes
--typeattributes prev-line # wrapAttributes
--wrapternary before-operators # wrap
--structthreshold 20 # organizeDeclarations
--enumthreshold 20 # organizeDeclarations
--organizetypes class,struct,enum,extension,actor # organizeDeclarations
--visibilityorder beforeMarks,instanceLifecycle,open,public,package,internal,fileprivate,private # organizeDeclarations
--typeorder nestedType,staticProperty,staticPropertyWithBody,classPropertyWithBody,swiftUIPropertyWrapper,instanceProperty,instancePropertyWithBody,staticMethod,classMethod,instanceMethod # organizeDeclarations
# --sortswiftuiprops first-appearance-sort #organizeDeclarations
--extensionacl on-declarations # extensionAccessControl
--patternlet inline # hoistPatternLet
--propertytypes inferred # redundantType, propertyTypes
--typeblanklines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope
--emptybraces spaced # emptyBraces
--ranges preserve # spaceAroundOperators
--operatorfunc no-space # spaceAroundOperators
--someAny disabled # opaqueGenericParameters
--elseposition same-line # elseOnSameLine
--guardelse next-line # elseOnSameLine
--onelineforeach convert # preferForLoop
--shortoptionals always # typeSugar
--semicolons never # semicolons
--doccomments preserve # docComments
--markcategories false
# --header Licensed under the MIT License. See License.txt in the project root for license information.
# We recommend a max width of 100 but _strictly enforce_ a max width of 130
--maxwidth 130 # wrap
# rules
--rules anyObjectProtocol
--rules blankLinesBetweenScopes
--rules consecutiveSpaces
--rules consecutiveBlankLines
--rules duplicateImports
--rules extensionAccessControl
# --rules environmentEntry
--rules hoistPatternLet
--rules indent
--rules markTypes
--rules organizeDeclarations
--rules redundantParens
--rules redundantReturn
--rules redundantSelf
--rules redundantType
--rules redundantPattern
--rules redundantGet
--rules redundantFileprivate
--rules redundantRawValues
# --rules redundantEquatable
--rules sortImports
--rules sortDeclarations
--rules strongifiedSelf
--rules trailingCommas
--rules trailingSpace
--rules linebreakAtEndOfFile
--rules typeSugar
--rules wrap
--rules wrapMultilineStatementBraces
--rules wrapArguments
--rules wrapAttributes
--rules braces
--rules redundantClosure
--rules redundantInit
--rules redundantVoidReturnType
--rules redundantOptionalBinding
--rules redundantInternal
--rules redundantProperty
--rules unusedArguments
--rules spaceInsideBrackets
--rules spaceInsideBraces
--rules spaceAroundBraces
--rules spaceInsideParens
--rules spaceAroundParens
--rules spaceAroundOperators
--rules enumNamespaces
--rules blockComments
--rules docComments
--rules docCommentsBeforeModifiers
--rules spaceAroundComments
--rules spaceInsideComments
--rules blankLinesAtStartOfScope
--rules blankLinesAtEndOfScope
--rules emptyBraces
--rules hoistAwait
--rules hoistTry
--rules hoistPatternLet
--rules andOperator
--rules opaqueGenericParameters
# --rules genericExtensions
--rules trailingClosures
--rules elseOnSameLine
--rules sortTypealiases
--rules preferForLoop
--rules conditionalAssignment
--rules wrapMultilineConditionalAssignment
--rules void
--rules blankLineAfterSwitchCase
--rules consistentSwitchCaseSpacing
--rules semicolons
--rules propertyTypes
--rules blankLinesBetweenChainedFunctions
--rules leadingDelimiters
--rules preferKeyPath
--rules unusedPrivateDeclarations
# --rules emptyExtensions
# --rules preferCountWhere
# --rules fileHeader