forked from adessoTurkey/ios-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.swiftlint.yml
146 lines (126 loc) · 3.05 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
142
143
144
145
146
disabled_rules: # rule identifiers to exclude from running
- opening_brace
- non_optional_string_data_conversion
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- Project/R.generated.swift
- Carthage
- .build
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
file_length:
warning: 500
error: 800
line_length:
warning: 175
error: 200
ignores_function_declarations: true
ignores_comments: true
ignores_interpolated_strings: true
ignores_urls: true
large_tuple: # warn user when using 3 values in tuple, give error if there are 4
- 3
- 4
opt_in_rules:
- closure_spacing
- conditional_returns_on_newline
- duplicate_imports
- empty_string
- force_unwrapping
- implicit_return
- let_var_whitespace
- nslocalizedstring_key
- private_action
- private_outlet
- switch_case_on_newline
- unneeded_parentheses_in_closure_argument
- control_statement
- empty_count
- trailing_newline
- colon
- comma
- custom_rules
- expiring_todo
- implicitly_unwrapped_optional
- operator_usage_whitespace
conditional_returns_on_newline:
severity: error
if_only: true
cyclomatic_complexity:
warning: 10
error: 20
ignores_case_statements: true
discouraged_direct_init:
severity: error
types:
- Bundle
- UIDevice
- UIScreen
- UIApplication
force_cast:
severity: error
force_try:
severity: error
force_unwrapping:
severity: error
function_parameter_count:
warning: 5
error: 5
identifier_name:
min_length:
warning: 3
error: 2
max_length:
warning: 40
error: 64
excluded:
- id
nesting:
type_level:
warning: 2
function_level:
warning: 3
switch_case_on_newline:
severity: error
type_name:
min_length:
warning: 3
max_length:
warning: 1000
excluded:
- "ID"
- "Id"
- "ios_boilerplateTests"
- "ios_boilerplateUITests"
unneeded_break_in_switch:
severity: error
expiring_todo:
date_format: "dd.MM.yyyy"
date_separator: "."
custom_rules:
no_objcMembers:
name: "@objcMembers"
regex: "@objcMembers"
message: "Explicitly use @objc on each member you want to expose to Objective-C"
severity: error
no_direct_standard_out_logs:
name: "Writing log messages directly to standard out is disallowed"
regex: "(\\bprint|\\bdebugPrint|\\bdump|Swift\\.print|Swift\\.debugPrint|Swift\\.dump)\\s*\\("
match_kinds:
- identifier
message: "Don't commit `print(…)`, `debugPrint(…)`, or `dump(…)` as they write to standard out in release. Either log to a dedicated logging system or silence this warning in debug-only scenarios explicitly using `// swiftlint:disable:next no_direct_standard_out_logs`"
severity: warning
no_file_literal:
name: "#file is disallowed"
regex: "(\\b#file\\b)"
match_kinds:
- identifier
message: "Instead of #file, use #fileID"
no_filepath_literal:
name: "#filePath is disallowed"
regex: "(\\b#filePath\\b)"
match_kinds:
- identifier
message: "Instead of #filePath, use #fileID."