-
Notifications
You must be signed in to change notification settings - Fork 0
/
swiftlint.yml
98 lines (70 loc) · 2.2 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
# Enable rules not from default list.
opt_in_rules:
# Delegate protocols should be class-only so they can be weakly referenced.
- class_delegate_protocol
# Closure bodies should not span too many lines.
- closure_body_length
# Prefer checking isEmpty over comparing count to zero.
- empty_count
# Prefer checking isEmpty over comparing string to an empty string literal.
- empty_string
# Prefer using .first(where:) over .filter { }.first in collections.
- first_where
# Prefer using .last(where:) over .filter { }.last in collections.
- last_where
# Force unwrapping should be avoided.
- force_unwrapping
# IBOutlets should be private to avoid leaking UIKit to higher layers.
- private_outlet
# IBActions should be private.
- private_action
# Prefer someBool.toggle() over someBool = !someBool.
- toggle_bool
# Fallthrough should be avoided.
- fallthrough
# Let and var should be separated from other statements by a blank line.
- let_var_whitespace
# Arguments should be either on the same line, or one per line.
- multiline_arguments
# Multiline arguments should have their surrounding brackets in a new line.
- multiline_arguments_brackets
# Chained function calls should be either on the same line, or one per line.
- multiline_function_chains
# Multiline literals should have their surrounding brackets in a new line.
- multiline_literal_brackets
# Functions and methods parameters should be either on the same line, or one per line.
- multiline_parameters
# Include a single empty line between switch cases.
- vertical_whitespace_between_cases
# Paths to ignore during linting. Takes precedence over `included`.
excluded:
- Carthage
- Pods
# Force rules.
force_cast: warning
force_unwrapping: warning
force_try: warning
# Length rules.
function_body_length:
warning: 50
error: 100
line_length: 120
file_length:
warning: 500
error: 700
closure_body_length:
warning: 10
error: 30
# Naming rules. Additionally they can set excluded names
type_name:
min_length: 2
max_length: 40
variable_name:
min_length: 1
max_length: 40
# Other rules.
# warning_threshold: 20
cyclomatic_complexity:
warning: 15
error: 20
reporter: "xcode"