-
Notifications
You must be signed in to change notification settings - Fork 13
/
.swiftlint.yml
123 lines (111 loc) · 3.26 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
whitelist_rules:
- anyobject_protocol
- closing_brace
- closure_end_indentation
- closure_parameter_position
- closure_spacing
- collection_alignment
- colon
- comma
- control_statement
- custom_rules
- cyclomatic_complexity
- discouraged_optional_boolean
- duplicate_imports
- empty_parameters
- empty_parentheses_with_trailing_closure
- empty_string
- explicit_init
- file_length
- first_where
- force_cast
- force_try
- force_unwrapping
- function_parameter_count
- implicit_getter
- implicitly_unwrapped_optional
- inert_defer
- last_where
- leading_whitespace
- legacy_cggeometry_functions
- legacy_constant
- legacy_constructor
- legacy_hashing
- legacy_nsgeometry_functions
- line_length
- literal_expression_end_indentation
- mark
- multiline_arguments
- multiline_literal_brackets
- opening_brace
- operator_usage_whitespace
- redundant_discardable_let
- redundant_optional_initialization
- redundant_nil_coalescing
- redundant_void_return
- return_arrow_whitespace
- shorthand_operator
- statement_position
- syntactic_sugar
- trailing_comma
- trailing_newline
- trailing_semicolon
- trailing_whitespace
- unused_import
- unused_optional_binding
- unused_setter_value
- vertical_whitespace
- void_return
disabled_rules: # rule identifiers to exclude from running
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Example/Pods
- .bundle
- Source/*/Deprecated
custom_rules:
open_iboutlets:
included: ".*.swift"
name: "IBOutlet opening"
regex: "@IBOutlet ?(weak){0,1} var"
message: "IBOutlet should be private or fileprivate"
severity: error
open_ibaction:
included: ".*.swift"
name: "IBAction opening"
regex: "@IBAction func"
message: "IBAction should be private or fileprivate"
severity: error
mark_newlines:
included: ".*.swift"
name: "MARK newlines surrounding"
regex: '(([}{)\w \t]+\n{1}[ \t]*)(\/\/ MARK: - [\w ]*))|((\/\/ MARK: - [\w ]*)(\n{1}[ \t]*\w+))'
message: "Every MARK should be surrounded with 1 newline before and 1 after it"
severity: warning
class_modificators_order:
include: ".*.swift"
name: "Class modificators order"
regex: "final (public|private|open)"
message: "Modificator should precede keyword final"
func_modificators_order:
include: ".*.swift"
name: "Func modificators order"
regex: "(static|class) (public|private|open) func"
message: "Modificator should precede keyword static or class"
empty_func_body:
included: ".*.swift"
name: "Empty function body"
regex: '(\{(([\n]|\n[ ]*)*)\})'
message: "Use { } for empty body"
severity: warning
line_length:
warning: 145
ignores_function_declarations: false
ignores_comments: true
ignores_interpolated_strings: false
ignores_urls: true
cyclomatic_complexity:
warning: 15
error: 20
file_length:
warning: 600
error: 1200
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit)