-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.swiftlint.yml
119 lines (105 loc) · 2.97 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
disabled_rules: # rule identifiers to exclude from running
- opening_brace
- operator_whitespace
- orphaned_doc_comment
opt_in_rules:
- empty_count
- force_unwrapping
- shorthand_optional_binding
- weak_delegate
excluded:
- "*.generated"
custom_rules:
custom_assert:
name: "Custom Assert..."
regex: "assert\\([^\\)]*\\)"
message: "Use JOSue Assert"
severety: error
combine_assign_to_self:
included: ".*\\.swift"
name: "`assign` to self"
regex: '\.assign\(to: [^,]*, on: self\)'
message: "For assigning on self, use assignNoRetain(to: ..., on: self)."
severity: error
duplicate_remove_duplicates:
included: ".*\\.swift"
name: "Duplicate `removeDuplicates()`"
message: "ViewStore's publisher already does `removeDuplicates()`"
regex: 'publisher\.[^(|{|,]*removeDuplicates\(\)'
severity: error
dont_scale_to_zero:
included: ".*\\.swift"
name: "Don't scale down to 0."
regex: "\\.scaleEffect\\([^\\)]*(\\ 0\\ [^\\)]*\\)|0.0(\\ |\\))|\\ 0(\\)|,))"
message: "Please make sure to pass a number not equal zero, so transformations don't throw warnings like `ignoring singular matrix`."
severity: error
use_data_constructor_over_string_member:
included: ".*\\.swift"
name: "Do not use String.data(using: .utf8)"
regex: "\\.?data\\(using: \\.utf8\\)"
message: "Please use Data(string.utf8) instead of String.data(using: .utf8) because the Data constructor is non-optional and Strings are guaranteed to be encodable as .utf8"
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
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
tca_use_observe_viewstore_api:
name: "TCA ViewStore observe API"
regex: 'ViewStore\(store\.scope'
message: "Use modern observe: api instead of store.scope"
severity: error
trailing_comma:
mandatory_comma: true
cyclomatic_complexity:
ignores_case_statements: true
warning: 20
file_length:
warning: 1000
error: 1000
identifier_name:
severity: warning
allowed_symbols: "_"
min_length: 2
max_length:
warning: 90
error: 90
excluded:
- iO
- id
- vc
- x
- y
- i
- pi
- d
legacy_constant: error
legacy_constructor: error
line_length:
warning: 180
error: 180
ignores_comments: true
ignores_urls: true
nesting:
type_level:
warning: 3
error: 3
function_level:
warning: 5
error: 5
function_parameter_count:
warning: 5
force_cast: warning
force_unwrapping: warning
type_body_length:
- 300 # warning
- 300 # error
large_tuple:
- 3 # warning
- 10 # error