-
Notifications
You must be signed in to change notification settings - Fork 4
/
.swiftlint.yml
117 lines (99 loc) · 2.8 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
disabled_rules:
- force_cast
- trailing_whitespace
opt_in_rules:
- array_init
- closure_spacing
- contains_over_first_not_nil
- explicit_init
- extension_access_modifier
- fatal_error_message
- first_where
- implicit_return
- joined_default_parameter
- let_var_whitespace
- literal_expression_end_indentation
- operator_usage_whitespace
- overridden_super_call
- prohibited_super_call
- quick_discouraged_call
- sorted_imports
- vertical_parameter_alignment_on_call
- todo
- unowned_variable_capture
- duplicate_enum_cases
- unused_capture_list
- toggle_bool
- vertical_whitespace_closing_braces
- required_enum_case
- private_outlet
- switch_case_on_newline
- empty_xctest_method
included: # paths to include during linting. `--path` is ignored if present.
- TryNetworkLayer
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
# These properties are marked as error by default.
force_try: warning
file_length:
warning: 500
error: 700
function_body_length:
warning: 150
error: 200
type_body_length:
warning: 300
error: 350
function_parameter_count:
warning: 10
error: 15
line_length:
warning: 160
error: 170
type_name:
min_length: 4
max_length:
warning: 50
error: 60
allowed_symbols: ["_"]
excluded:
- R
- D
identifier_name:
min_length: 2
max_length:
warning: 50
error: 60
allowed_symbols: ["_"]
excluded:
- id
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji)
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
double_space: # From https://github.com/IBM-Swift/Package-Builder
include: "*.swift"
name: "Double space"
regex: "([a-z,A-Z] \\s+)"
message: "Double space between keywords"
match_kinds: keyword
severity: warning
mark_newline:
include: "*.swift"
name: "MARK new line"
regex: "(^ *\\/\\/ MARK:\ [ a-zA-Z0-9=?.\\(\\)\\{\\}:,><!-]*\n *(?!(?:\\}|return))\\S+)"
message: "// MARK: should have new line after"
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
new_line_between_import:
name: "New line between import"
regex: "import(.*?)\n\n+import"
message: "No new line between import"
severity: warning