-
Notifications
You must be signed in to change notification settings - Fork 8
/
.swiftlint.yml
216 lines (183 loc) · 4.48 KB
/
.swiftlint.yml
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
# TODO: 5, 6, 17, 18, 25, 31, 36(static vars)
# 12 (newline above return) ignored
included:
- Source/
- Tests/
- Example/
excluded:
- Pods/
disabled_rules:
- leading_whitespace
- nesting
opt_in_rules:
conditional_returns_on_newline
operator_usage_whitespace
file_header
# single_test_class
# explicit_acl
# Rule Configuration
# 26 (errors over warnings)
## Enabled (by default)
trailing_newline: error # 29
return_arrow_whitespace: error # 2
opening_brace: error # 3, 4, 9, 10, 11, 14, 37, 38
comma: error # 15
operator_whitespace: error # 39
block_based_kvo: error
class_delegate_protocol: error
closing_brace: error
closure_parameter_position: error
compiler_protocol_init: error
control_statement: error
discarded_notification_center_observer: error
dynamic_inline: error
empty_enum_arguments: error
empty_parameters: error
empty_parentheses_with_trailing_closure: error
fallthrough: error
for_where: error
force_cast: error
force_try: error
implicit_getter: error
is_disjoint: error
legacy_cggeometry_functions: error
legacy_constant: error
legacy_constructor: error
legacy_nsgeometry_functions: error
mark: error
multiple_closures_with_trailing_closure: error
notification_center_detachment: error
protocol_property_accessors_order: error
redundant_discardable_let: error
redundant_optional_initialization: error
redundant_string_enum_value: error
redundant_void_return: error
shorthand_operator: error
superfluous_disable_command: error
switch_case_alignment: error
syntactic_sugar: error
todo: warn
trailing_semicolon: error
unneeded_break_in_switch: error
unused_closure_parameter: error
unused_enumerated: error
valid_ibinspectable: error
vertical_parameter_alignment: error
void_return: error
weak_delegate: error
xctfail_message: error
custom_rules: error
colon: # 1, 7, 8, 19, 27, 28
severity: error
flexible_right_spacing: false
apply_to_dictionaries: true
vertical_whitespace: # 16, 22, 23, 24
severity: error
max_empty_lines: 1
type_name: # 30, 33, 34, 35
min_length:
warning: 3
error: 3
max_length:
warning: 40
error: 40
excluded: ""
allowed_symbols: ""
validates_starts_with_lowercase: true
identifier_name: # 32
min_length:
warning: 2
error: 2
max_length:
warning: 40
error: 40
excluded: ""
allowed_symbols: ""
validates_starts_with_lowercase: false
generic_type_name:
min_length:
warning: 0
error: 0
max_length:
warning: 20
error: 20
excluded: ""
allowed_symbols: ""
validates_starts_with_lowercase: true
cyclomatic_complexity:
severity: error
ignores_case_statements: true
discouraged_direct_init:
severity: error
discouraged_inits:
- "Bundle"
- "UIDevice"
file_line_length:
severity: error
ignore_comment_only_lines: false
function_body_length:
warning: 40
error: 100
function_parameter_count:
warning: 5
error: 8
large_tuple:
warning: 2
error: 3
line_length:
warning: 150
error: 200
ignores_urls: false
ignores_function_declarations: true
ignores_comments: false
private_over_fileprivate:
severity: error
validate_extensions: false
private_unit_test:
severity: warning
regex: "XCTestCase"
statement_position:
severity: error
statement_mode: default
trailing_comma:
severity: error
mandatory_comma: false
trailing_whitespace:
severity: error
ignores_empty_lines: true
ignores_comments: true
type_body_length:
warning: 400
error: 450
unused_optional_binding:
severity: error
ignore_optional_try: false
file_length:
warning: 600
## Opt-In
conditional_returns_on_newline: error
operator_usage_whitespace: error # 13, 20, 21
file_header:
severity: error
required_string: ""
custom_rules:
unnecessary_closure_parenthesis:
name: "Unnecessary Closure Parenthesis"
message: "Omit the parentheses when using closures; only the curly brackets are needed"
regex: "\\(\\s*?\\{[\\s\\S]*?\\}\\s*?\\)"
severity: error
unnecessary_closure_parameter_parenthesis:
name: "Unnecessary Closure Parameter Parenthesis"
message: "Omit the parentheses around the parameters in a closure."
regex: "\\{\\s*\\(.*\\)\\s*in[\\s\\S]*\\}"
severity: error
same_line_return:
name: "Same Line Return"
message: "Do not return on the same line and instead prefer to return on a new line."
regex: "else\\b[^\\n]*\\}"
severity: error
# improper_test_value:
# name: "Improper Test Value"
# message: "You must ALWAYS use 'derp' when coding your test values! ALWAYS."
# regex: "(blargh|blergh)"
# severity: error