-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftlint_base.yml
42 lines (41 loc) · 1.71 KB
/
.swiftlint_base.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
# rule identifiers to exclude from running
disabled_rules:
- file_length
- identifier_name
- line_length
- notification_center_detachment
- redundant_string_enum_value
- todo
- trailing_whitespace
- valid_ibinspectable
custom_rules:
swiftgen_assets:
name: "SwiftGen Assets"
regex: '(UIImage|UIColor)(\.init)?\(named: ?"?.+"?(, ?in:.+?, ?compatibleWith:.+?)?\)|#imageLiteral\(resourceName: ?".+"\)'
message: "Use Asset.<asset> instead"
severity: warning
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: warning
swiftgen_files:
name: "SwiftGen Files"
regex: '(url\(forResource: ?"?.+"?, ?withExtension: ?"?.+"?, ?subdirectory: ?"?.+"?(, ?localization: ?"?.+"?)?\))|(path\(forResource: ?"?.+"?, ?ofType: ?"?.+"?(, ?inDirectory: ?"?.+"?(, ?forLocalization: ?"?.+"?)?)?\))'
message: "Use Files.<dir/file> instead"
severity: warning
swiftgen_fonts:
name: "SwiftGen Fonts"
regex: 'UIFont(\.init)?\(name: ?"?.+"?, ?size:.+?\)'
message: "Use FontFamily.<family>.<variant>.size(<size>) instead"
severity: warning
swiftgen_storyboards:
name: "SwiftGen Storyboard Scenes"
regex: '(UIStoryboard\(name: ?"?.+"?, ?bundle:.+\))|(instantiateViewController\(withIdentifier:.+?\))|(instantiateInitialViewController\(\))'
message: "Use StoryboardScene.<storyboad>.<scene>.instantiate() instead"
severity: warning
swiftgen_strings:
name: "SwiftGen Strings"
regex: 'NSLocalizedString'
message: "Use L10n.key instead"
severity: warning