-
Notifications
You must be signed in to change notification settings - Fork 81
/
.swiftlint.yml
154 lines (151 loc) · 3.71 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
only_rules:
# Spacing
- opening_brace
- closing_brace
- closure_spacing
- comma
- colon
- comment_spacing
# Whitespace (Xcode configuration)
- leading_whitespace
- let_var_whitespace
- operator_whitespace
- operator_usage_whitespace
- return_arrow_whitespace
- no_space_in_method_call
# Empty
- empty_collection_literal
- empty_count
- empty_string
- empty_xctest_method
# Force
- force_cast
- force_try
- force_unwrapping
# Closures
- closure_body_length
- closure_end_indentation
- closure_parameter_position
# Style
- collection_alignment
- control_statement
- file_header
- discouraged_assert
- discouraged_optional_boolean
- implicit_getter
- prefer_zero_over_explicit_init
- statement_position
- unavailable_function
- unneeded_break_in_switch
- void_return
- xct_specific_matcher
- xctfail_message
- prefer_self_type_over_type_of_self
- syntactic_sugar
- explicit_init
# - unneeded_parentheses_in_closure_argument - to discuss
# Order
- file_types_order
- modifier_order
- protocol_property_accessors_order
- computed_accessors_order
# Lint
- anyobject_protocol
- class_delegate_protocol
- cyclomatic_complexity
- block_based_kvo
- compiler_protocol_init
- deployment_target
- overridden_super_call
# Collections
- array_init
- first_where
- last_where
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
# Redundant
- redundant_discardable_let
- redundant_optional_initialization
- redundant_set_access_control
- redundant_type_annotation
- redundant_void_return
- redundant_nil_coalescing
# Unused
- unused_capture_list
- unused_closure_parameter
- unused_declaration
- unused_enumerated
- unused_optional_binding
- unused_setter_value
# Custom
- custom_rules
# Spacing
opening_brace:
severity: error
closing_brace:
severity: error
closure_spacing:
severity: error
comma:
severity: error
colon:
severity: error
# Whitespace
leading_whitespace:
severity: error
operator_whitespace:
severity: error
operator_usage_whitespace:
severity: warning
return_arrow_whitespace:
severity: error
# Empty
empty_collection_literal:
severity: error
empty_count:
severity: error
empty_string:
severity: error
# Closures
closure_body_length:
warning: 50
error: 100
closure_end_indentation:
severity: error
closure_parameter_position:
severity: error
collection_alignment:
severity: error
control_statement:
severity: error
anyobject_protocol:
severity: error
class_delegate_protocol:
severity: error
cyclomatic_complexity:
severity: error
syntactic_sugar :
severity: error
file_header:
severity: error
required_pattern: |
\/\*
\* Copyright \(c\) \d{4}(-Present)?, Okta, Inc. and\/or its affiliates\. All rights reserved\.
\* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 \(the "License."\)
\*
\* You may obtain a copy of the License at http:\/\/www.apache.org\/licenses\/LICENSE-2.0.
\* Unless required by applicable law or agreed to in writing, software
\* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
\* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\*
\* See the License for the specific language governing permissions and limitations under the License.
custom_rules:
multiple_empty_lines:
name: "Multiple Empty Lines"
regex: '((?:\s*\n){3,})'
message: "There are too many line breaks"
severity: error
# Paths to ignore
excluded:
- Pods