forked from mylifeasdog/Pictures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
141 lines (141 loc) · 3.68 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
disabled_rules:
- function_parameter_count
- line_length
- nesting
- opening_brace
- trailing_whitespace
- weak_delegate
- type_name
opt_in_rules:
- attributes
- closure_spacing
- empty_count
- explicit_init
- fatal_error_message
- first_where
- force_unwrapping
- implicitly_unwrapped_optional
- nimble_operator
- number_separator
- object_literal
- operator_usage_whitespace
- overridden_super_call
- private_outlet
- prohibited_super_call
- redundant_nil_coalescing
- redundant_string_enum_value
- sorted_imports
- switch_case_on_newline
excluded:
- Carthage
- Pods
- DataManagerTests/Mock/GeneratedMocks.swift
attributes:
severity: error
closing_brace: error
closure_parameter_position: error
closure_spacing: error
colon:
severity: error
comma: error
control_statement: error
empty_count: error
empty_parameters: error
empty_parentheses_with_trailing_closure: error
explicit_init: error
file_length:
warning: 800
error: 1600
first_where: error
force_unwrapping:
severity: error
function_body_length:
warning: 200
error: 400
identifier_name:
excluded:
- id
- qs
- ok
- _id
- h1
- h2
- h3
- t1
- t2
- translatesAutoresizingMaskIntoConstraints
implicit_getter: error
implicitly_unwrapped_optional:
severity: error
leading_whitespace: error
legacy_cggeometry_functions: error
legacy_constant: error
legacy_constructor: error
mark: error
nimble_operator: error
number_separator:
severity: error
object_literal: error
operator_whitespace: error
operator_usage_whitespace: error
prohibited_super_call:
severity: error
redundant_nil_coalescing: error
redundant_string_enum_value: error
return_arrow_whitespace: error
sorted_imports: error
statement_position:
statement_mode: uncuddled_else
syntactic_sugar: error
trailing_comma:
severity: error
trailing_newline: error
trailing_semicolon: error
type_body_length:
warning: 500
error: 700
unused_closure_parameter: error
unused_enumerated: error
unused_optional_binding: error
vertical_whitespace:
severity: error
void_return: error
custom_rules:
else_if_spacing:
name: "Else if spacing"
regex: '(?:\n|[^\w#])else\s{2,}if'
message: "Between else and if should have only one space"
severity: error
# newline_opening_brace:
# name: "Newline opening brace"
# regex: '(?:(?:\n|[^\w#])(?:if|else if|switch|for|while|func|class|struct|init|catch)\s+[^\{]+\S[^\S\n\r]*\{[^\}]+(?:\n|\r)[^\S\n\r]*\}|(?:\n|[^\w#])(?:else|repeat|deinit|do)[^\w\S\n\r]*\{[^\}]+(?:\n|\r)[^\S\n\r]*\})'
# message: "Opening brace must put into new line"
# severity: error
# guard_newline_opening_brace:
# name: "Newline opening brace"
# regex: '(?:\n|[^\w])guard\s+[^\n\r]+((?:\n|\r)[^\n\r]+)*\s+else[^\S\n\r]*\{'
# message: "Opening brace must put into new line"
# severity: error
empty_condition_statement:
name: "Empty condition statement"
message: "Condition statement should not empty (put '// ;' in empty statement instead)"
regex: '[^\w\.#](?:if |else if |else)[^,{]*\{\s*\}'
severity: warning
mark_newline:
name: "Mark surrounding empty newlines"
regex: '(?:[^\r\n\t\f \{](?:\n|\r)[^\S\n\r]*\/\/ MARK: -?|\/\/ MARK: -?[^\n\r]*(?:\n|\r)[^\S\n\r]*\w)'
message: "Mark must surronding by empty newlines"
severity: error
match_kinds:
- comment
- comment.mark
- comment.url
deprecated_then:
name: "Then function is deprecating"
message: "Try not to use '.then'. It made compile time much slower."
regex: '\.then\s*\{'
severity: warning
# constructor_map:
# name: "Prefer use init constructor in map"
# regex: ".map \{ (?:)\}"
# message: "Prefer use init constructor in map"