This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.swiftlint.yml
128 lines (115 loc) · 3.14 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
opt_in_rules:
- attributes
- closure_end_indentation
- closure_spacing
- contains_over_first_not_nil
- empty_count
- empty_string
- explicit_init
- fatal_error_message
- file_header
- first_where
- multiline_arguments
- multiline_function_chains
- multiline_parameters
- no_extension_access_modifier
- operator_usage_whitespace
- overridden_super_call
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- switch_case_on_newline
- unneeded_parentheses_in_closure_argument
- yoda_condition
# Experimental
# analyzer_rules:
# - unused_import
# - unused_private_declaration
disabled_rules:
- cyclomatic_complexity
- empty_parentheses_with_trailing_closure
- trailing_whitespace
- private_over_fileprivate
- force_cast
- force_try
attributes:
always_on_same_line:
- '@objc'
- '@IBAction'
line_length:
warning: 200
error: 300
ignores_comments: true
ignores_function_declarations: true
file_length:
ignore_comment_only_lines: true
type_body_length:
warning: 300
error: 400
vertical_whitespace:
max_empty_lines: 2
large_tuple:
warning: 4
identifier_name:
excluded:
- id
- vc
multiline_arguments:
only_enforce_after_first_closure_on_first_line: true
custom_rules:
single_line_return:
included: ".*.swift"
regex: '\.\S+ *\{(?: *return|[^\n\}]+ in return) [^\}]+\}'
name: "Single Line Return"
message: "Remove the 'return' when returning from a single line closure."
severity: warning
vertical_whitespace_closing_braces:
included: ".*.swift"
regex: '(?<=\n)[ \t]*\n[ \t]*[)}\]]'
name: "Vertical Whitespace before Closing Braces"
message: "Don't include vertical whitespace (empty line) before closing braces."
severity: warning
comments_space:
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: warning
empty_line_after_guard:
name: "Empty Line After Guard"
regex: '(^ *guard[ a-zA-Z0-9=?.\(\),><!]*\{[ a-zA-Z0-9=?.\(\),><!]*\}\n *(?!(?:return|guard))\S+)'
message: "There should be an empty line after a guard"
severity: warning
empty_line_after_super:
name: "Empty Line After Super"
regex: '(^ *super\.[ a-zA-Z0-9=?.\(\)\{\}:,><!]*\n *(?!(?:\}|return))\S+)'
message: "There should be an empty line after super"
severity: warning
double_space:
include: "*.swift"
name: "Double space"
regex: '([a-z,A-Z] \s+)'
message: "Don't use double space between keywords"
match_kinds: keyword
severity: warning
empty_commented_line:
name: "Empty Commented Out Line"
regex: '(\t+| +)//\n'
message: "Remove useless comment lines or use /* format */"
severity: warning
missing_closure_name:
name: "Missing closure name"
regex: '^\s*\}\) \{.*'
message: "Add the missing closure name"
severity: warning
vertical_whitespace_except_for_marks:
name: "More than one vertical whitespace"
regex: '(?:\n[^\S\n]*){2,}\n(?![^\S\n]*\/\/ MARK:)'
message: "More than one empty line is not allowed, excecpt for two before // MARK:"
severity: warning
included:
- Caronae
- CaronaeUITests
excluded:
- Pods
- fastlane
- CaronaeUITests/SnapshotHelper.swift