-
Notifications
You must be signed in to change notification settings - Fork 17
/
.swiftlint.yml
73 lines (67 loc) · 1.95 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
warning_threshold: 1000
excluded:
- Pods
- Templates
- "*/.build"
disabled_rules:
- identifier_name
- cyclomatic_complexity
- large_tuple
- trailing_whitespace
- force_try
- force_cast
- function_body_length
- multiple_closures_with_trailing_closure
- redundant_string_enum_value
- inert_defer
- nesting
- type_name
- opening_brace
- shorthand_operator
- todo
- trailing_comma
- line_length
function_parameter_count:
warning: 15
error: 20
file_length:
warning: 500
error: 700
type_body_length:
warning: 400
custom_rules:
swiftgen_assets:
name: "SwiftGen Assets"
regex: '(UIImage|UIColor)(\.init)?\(named: ?"?.+"?(, ?in:.+?, ?compatibleWith:.+?)?\)|#imageLiteral\(resourceName: ?".+"\)'
message: "Use Asset.<asset> instead"
severity: error
swiftgen_colors:
name: "SwiftGen Colors"
regex: '(UIColor(\.init)?|#colorLiteral)\(((red|displayP3Red):.+?,green:.+?,blue:.+?,alpha:.+?)|(white:.+?,alpha:.+?)|(hue:.+?,saturation:.+?,brightness:.+?,alpha:.+?)\)'
message: "Use ColorName.<color> instead"
severity: error
swiftgen_fonts:
name: "SwiftGen Fonts"
regex: 'UIFont(\.init)?\(name: ?"?.+"?, ?size:.+?\)'
message: "Use FontFamily.<family>.<variant>.size(<size>) instead"
severity: error
swiftgen_strings:
name: "SwiftGen Strings"
regex: 'NSLocalizedString'
message: "Use L10n.key instead"
severity: error
paragraph_style:
name: "Pragraph style"
regex: 'NSParagraphStyle\(\)'
message: "Don't construct NSParagraphStyle directly, use withParagraphStyle() method on NSMutableAttributedString instead"
severity: warning
clipboard_direct_api:
name: "UIPasteboard"
regex: 'UIPasteboard.general'
message: "Use ClipboardManager instead"
severity: warning
timer_memory_leak:
name: "Timer with target causes memory leak, use block instead"
regex: 'Timer.scheduledTimer\(.+selector'
message: "Use block instead"
serverity: error