-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.swiftlint.yml
127 lines (110 loc) · 2.69 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
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit)
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
# If you need help with rules run $ swiftlint
opt_in_rules:
- closure_end_indentation
- closure_spacing
- comments_space
- comments_capitalized_ignore_possible_code
- comments_capitalized_find_possible_code
- empty_count
- explicit_init
- explicit_failure_calls
- extension_access_modifier
- fatal_error_message
- first_where
# - force_cast
- force_unwrapping
- implicitly_unwrapped_optional
- missing_docs
- multiline_parameters
- multiple_empty_lines
- nesting
- number_separator
- operator_usage_whitespace
- overridden_super_call
# - private_outlet
- prohibited_super_call
- protocol_property_accessors_order
- redundant_nil_coalescing
- sorted_imports
- syntactic_sugar
- vertical_parameter_alignment_on_call
- vertical_whitespace
disabled_rules: # rule identifiers to exclude from running
- force_cast
- large_tuple
# - force_try
# - class_delegate_protocol
# - function_parameter_count
# - function_body_length
# - todo
# - discarded_notification_center_observer
# - conditional_returns_on_newline
cyclomatic_complexity:
ignores_case_statements: true
warning: 20
file_length:
warning: 1000
error: 1500
line_length:
warning: 180
error: 350
ignores_comments: true
ignores_function_declarations: true
ignores_urls: true
nesting:
type_level:
warning: 3
error: 6
statement_level:
warning: 5
error: 10
identifier_name:
allowed_symbols: "_"
min_length: 2
max_length:
warning: 90
error: 1000
excluded:
- id
implicitly_unwrapped_optional:
mode: all_except_iboutlets
large_tuple:
warning: 4
error: 5
type_body_length:
warning: 1000
error: 1000
trailing_comma:
mandatory_comma: true
number_separator:
minimum_length: 8
private_outlet:
allow_private_set: true
colon:
severity: error
comma: error
empty_count: error
legacy_constant: error
legacy_constructor: error
opening_brace: error
trailing_newline: error
trailing_semicolon: error
custom_rules:
comments_space: # From https://github.com/brandenr/swiftlintconfig
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: warning
explicit_failure_calls:
name: “Avoid asserting ‘false’”
regex: ‘((assert|precondition)\(false)’
message: “Use assertionFailure() or preconditionFailure() instead.”
severity: warning
multiple_empty_lines:
name: "Multiple Empty Lines"
regex: '((?:\s*\n){3,})'
message: "There are too many line breaks"
severity: error