-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.swiftlint.yml
206 lines (160 loc) · 5.14 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
# COMMAND LINE RULES: ./swiftlint rules
# RULES URL: https://github.com/realm/SwiftLint/blob/master/Rules.md
# RULES CONFIG URL: https://github.com/realm/SwiftLint/tree/master/Source/SwiftLintFramework/Rules/RuleConfigurations
disabled_rules: # rule identifiers to exclude from running
# String enum values can be omitted when they are equal to the enumcase name
- redundant_string_enum_value
# Operators should be surrounded by a single whitespace when defining them.
- operator_whitespace
# since 0.38.2
- orphaned_doc_comment # weird false-positives
# since 0.40.0
- computed_accessors_order
opt_in_rules: # some rules are only opt-in
# nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant
- redundant_nil_coalescing
# Some methods should not call super
- prohibited_super_call
# Some overridden methods should always call super
- overridden_super_call
# Implicitly unwrapped optionals should be avoided when possible.
- implicitly_unwrapped_optional
# Force unwrapping should be avoided.
- force_unwrapping
# Prefer using .first(where:) over .filter { }.first in collections.
- first_where
# Prefer to use extension access modifiers
- extension_access_modifier
# Prefer checking isEmpty over comparing count to zero.
- empty_count
# Closure expressions should have a single space inside each brace.
- closure_spacing
# Operators should be surrounded by a single whitespace when they are being used.
- operator_usage_whitespace
# Explicitly calling .init() should be avoided.
- explicit_init
# Function parameters should be aligned vertically if they're in multiple lines in a method call.
- vertical_parameter_alignment_on_call
# Functions and methods parameters should be either on the same line, or one per line.
- multiline_parameters
# IBOutlets should be private to avoid leaking UIKit to higher layers.
- private_outlet
- private_action
# Parentheses are not needed when declaring closure arguments.
- unneeded_parentheses_in_closure_argument
# Closure parameters should be on the same line as opening brace.
- closure_parameter_position
- let_var_whitespace
- discouraged_direct_init
- joined_default_parameter
- contains_over_first_not_nil
- array_init
- literal_expression_end_indentation
- single_test_class
- sorted_first_last
- discouraged_optional_boolean
- modifier_order
- fallthrough
- lower_acl_than_parent
- override_in_extension
- untyped_error_in_catch
- empty_string
- empty_xctest_method
- convenience_type
- redundant_set_access_control
- unavailable_function
- legacy_multiple
- reduce_into
- collection_alignment
- discouraged_object_literal
- identical_operands
- last_where
- redundant_type_annotation
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- legacy_random
#opt-in since 0.28.0
- toggle_bool
# opt-in since 0.35.0
- contains_over_filter_count
- contains_over_filter_is_empty
- empty_collection_literal
# opt-in since 0.36.0
- contains_over_range_nil_comparison
- flatmap_over_map_reduce
# opt-in since 0.38.1
- enum_case_associated_values_count
- optional_enum_case_matching
- prefer_self_type_over_type_of_self
# opt-in since 0.40.0
- ibinspectable_in_extension
- direct_return
- discarded_notification_center_observer
- discouraged_assert
- explicit_enum_raw_value
- self_binding
- trailing_closure
- unhandled_throwing_task
- vertical_whitespace_between_cases
- legacy_objc_type
# opt-in since 0.53.0
- private_swiftui_state
analyzer_rules:
- unused_import
# opt-in since 0.34.0
- unused_declaration
- typesafe_array_init
# configurations
first_where: error
contains_over_first_not_nil: error
contains_over_filter_count: error
contains_over_filter_is_empty: error
contains_over_range_nil_comparison: error
sorted_first_last: error
reduce_into: error
last_where: error
extension_access_modifier: error
lower_acl_than_parent: error
closure_spacing: error
explicit_init:
severity: error
private_outlet: error
private_action: error
convenience_type: error
vertical_whitespace_opening_braces: error
vertical_whitespace_closing_braces:
severity: warning
comma: error
duplicate_imports: error
legacy_constructor: error
force_unwrapping: error
function_body_length:
error: 50
trailing_whitespace:
ignores_empty_lines: true
ignores_comments: true
ignores_urls: true
nesting:
type_level: 3
severity: error
private_outlet:
allow_private_set: true
severity: error
line_length:
warning: 180
error: 180
ignores_function_declarations: true
ignores_urls: true
ignores_comments: true
ignores_interpolated_strings: true
identifier_name:
min_length: 1
severity: error
type_name:
max_length:
warning: 50
error: 60
file_length:
warning: 400
error: 600
ignore_comment_only_lines: true