-
Notifications
You must be signed in to change notification settings - Fork 23
/
.swiftlint.yml
54 lines (53 loc) · 1.63 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
opt_in_rules:
- implicit_return
- modifier_order
- first_where
- fatal_error_message
- empty_string
- empty_count
- convenience_type
- toggle_bool
- redundant_nil_coalescing
- sorted_first_last
- contains_over_first_not_nil
- contains_over_filter_count
- contains_over_filter_is_empty
- last_where
- redundant_type_annotation
- enum_case_associated_values_count
disabled_rules:
- trailing_whitespace
- identifier_name
- file_length
- multiple_closures_with_trailing_closure
- type_name
- unused_setter_value
- type_body_length
- weak_delegate
- function_parameter_count
- cyclomatic_complexity
- nesting
- duplicate_imports
excluded:
- AltSwiftUITests.swift
function_body_length:
warning: 60
error: 100
line_length:
warning: 400
error: 600
custom_rules:
travel_verb_getter_function:
name: "Verb Prefixed Getter Function"
regex: '(?<=func\s)(get|calculate|fetch|retrieve|generate)\w+\([^\)]*\)[\n\t\s]+\-\>[\n\t\s]+\w+\??[\n\t\s]+\{'
message: "Avoid the use of verbs on getter methods unless its a mutating/nonmutating method pair or a factory method."
travel_danger_dictionary_function:
name: "Dictionary initializer is error prone"
regex: 'Dictionary\(uniqueKeysWithValues'
message: "Avoid use of uniqueKeysWithValues initializer as it is crash prone."
severity: error
# Uncomment to find closure assignments to non-self variables and possible harder to find retain cycles
# find_non_self_stored_closures:
# name: "Stored closure in variable"
# regex: '[A-z0-1\_\-]+\.[A-z0-1\_\-]+\ \=\ \{'
# message: "Found assignment of stored closure of variable"