-
Notifications
You must be signed in to change notification settings - Fork 78
/
.swiftlint.yml
247 lines (221 loc) · 5.31 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
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
excluded:
- "**/*.generated.swift"
- "Templates"
- "scripts"
- ".devxp"
- ".build"
- "Package.swift"
- "App/.build"
- "build"
- "Project.swift"
- ".tuist-bin"
- "**/Generated"
- "**/SwifterSwift"
- "**/Derived"
- "**/.build"
- ".vscode"
disabled_rules:
- todo
- redundant_optional_initialization
- trailing_comma
- identifier_name
- type_name
- block_based_kvo
- prefer_self_in_static_references
opt_in_rules:
- anyobject_protocol
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- colon
- conditional_returns_on_newline
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- convenience_type
- discarded_notification_center_observer
- discouraged_assert
- discouraged_none_name
- discouraged_object_literal
# - discouraged_optional_boolean
# - discouraged_optional_collection
- empty_collection_literal
- empty_count
- empty_string
- enum_case_associated_values_count
- expiring_todo
- explicit_init
- extension_access_modifier
- fallthrough
- fatal_error_message
- file_name_no_space
- first_where
- flatmap_over_map_reduce
- force_unwrapping
# - function_default_parameter_at_end
- identical_operands
- implicitly_unwrapped_optional
- joined_default_parameter
- last_where
- legacy_multiple
- legacy_objc_type
- legacy_random
- let_var_whitespace
- literal_expression_end_indentation
- lower_acl_than_parent
- modifier_order
# - multiline_arguments
# - multiline_arguments_brackets
- multiline_function_chains
- multiline_literal_brackets
# - multiline_parameters
# - multiline_parameters_brackets
- notification_center_detachment
- operator_usage_whitespace
- optional_enum_case_matching
- orphaned_doc_comment
- overridden_super_call
- pattern_matching_keywords
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_subject
- prohibited_interface_builder
- reduce_into
- redundant_type_annotation
- return_value_from_void_function
- sorted_first_last
- sorted_imports
- static_operator
- strict_fileprivate
# - switch_case_on_newline
- test_case_accessibility
- toggle_bool
# - type_contents_order
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- unused_capture_list
- vertical_whitespace_between_cases
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- xct_specific_matcher
- yoda_condition
analyzer_rules:
- unused_declaration
- unused_import
# - capture_variable
- typesafe_array_init
force_cast: warning
force_try: warning
function_body_length:
warning: 60
type_body_length:
warning: 300
file_length:
warning: 500
#type_name:
# max_length: 50
function_parameter_count:
warning: 7
legacy_hashing: error
identifier_name:
excluded:
- i
- id
- x
- y
- z
- to
- iO
- vc
- by
allowedSymbols: [_]
#indentation_width:
# indentation_width: 2
# include_comments: false
line_length:
warning: 150
ignores_urls: true
ignores_function_declarations: true
ignores_comments: true
#multiline_arguments:
# first_argument_location: same_line
# only_enforce_after_first_closure_on_first_line: true
modifier_order:
preferred_modifier_order:
[
override,
acl,
setterACL,
dynamic,
mutators,
lazy,
final,
required,
convenience,
typeMethods,
owned,
]
private_over_fileprivate:
validate_extensions: true
trailing_whitespace:
ignores_empty_lines: false
ignores_comments: true
vertical_whitespace:
max_empty_lines: 1
nesting:
type_level: 2
cyclomatic_complexity:
warning: 30
error: 40
large_tuple:
warning: 3
error: 4
#type_contents_order:
# order:
# [
# [case],
# [type_alias, associated_type],
# [subtype],
# [type_property],
# [instance_property],
# [ib_inspectable],
# [ib_outlet],
# [initializer],
# [type_method],
# [view_life_cycle_method],
# [ib_action],
# [other_method],
# [subscript],
# [deinitializer],
# ]
custom_rules:
# tca_feature_actions:
# name: "Boundries"
# regex: '\._internal\(\s*((\w+\.)*|\.)\w+\(\s*((\w+\.)*|\.)(view|_internal).*?' # matching pattern
# capture_group: 5
# match_kinds:
# - identifier
# message: "Only access Delegate actions of directly embeeded features."
# severity: error
tca_explicit_generics_reducer:
included: ".*\\.swift"
name: "Explicit Generics for Reducer"
regex: 'Reduce\s+\{'
message: "Use explicit generics in ReducerBuilder (Reduce<State, Action>) for successful autocompletion."
# severity: error
severity: warning
tca_scope_unused_closure_parameter:
name: "TCA Scope Unused Closure Parameter"
regex: '\.scope\(\s*state\s*:\s*\{\s*\_'
message: "Explicitly use closure parameter when scoping store (ensures the right state is being mutated)"
# severity: error
severity: warning
xctassertnodifference_preferred:
name: "XCTAssertNoDifference Preferred"
regex: 'XCTAssertEqual\('
message: "Use PointFree's XCTAssertNoDifference from CustomDump library when possible"
severity: warning