-
Notifications
You must be signed in to change notification settings - Fork 3
/
.swiftlint.yml
132 lines (131 loc) · 3.61 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
identifier_name:
min_length: 2
excluded:
- x
- y
type_name:
excluded:
- T
superfluous_disable_command:
severity: warning
number_separator:
minimum_length: 5
private_outlet:
allow_private_set: true
nesting:
type_level: 3
disabled_rules:
- force_cast
- force_try
opt_in_rules:
- closure_spacing
- closure_body_length
- conditional_returns_on_newline
- empty_count
- explicit_init
- overridden_super_call
- redundant_nil_coalescing
- closure_end_indentation
- first_where
- attributes
- prohibited_super_call
- number_separator
- object_literal
- fatal_error_message
- private_outlet
- implicit_return
- multiline_parameters
- vertical_parameter_alignment_on_call
- unneeded_parentheses_in_closure_argument
- joined_default_parameter
- pattern_matching_keywords
- array_init
- contains_over_first_not_nil
- let_var_whitespace
- literal_expression_end_indentation
- multiline_arguments
- sorted_first_last
- strict_fileprivate
- discouraged_object_literal
- discouraged_optional_boolean
- empty_string
- private_action
- unneeded_break_in_switch
- unused_enumerated
- unused_optional_binding
- valid_ibinspectable
- convenience_type
- modifier_order
- multiline_function_chains
- single_test_class
- superfluous_disable_command
- unavailable_function
- no_fallthrough_only
- anyobject_protocol
- redundant_type_annotation
- collection_alignment
- identical_operands
- legacy_random
- toggle_bool
- unused_declaration
- unused_import
- last_where
- no_extension_access_modifier
- nslocalizedstring_key
- static_operator
- trailing_closure
- empty_xctest_method
- legacy_multiple
- nimble_operator
- operator_usage_whitespace
- quick_discouraged_call
- quick_discouraged_focused_test
- quick_discouraged_pending_test
- reduce_into
- required_enum_case
- switch_case_on_newline
- xct_specific_matcher
- yoda_condition
- contains_over_filter_count
- contains_over_filter_is_empty
- discouraged_optional_collection
- empty_collection_literal
- contains_over_range_nil_comparison
- flatmap_over_map_reduce
- raw_value_for_camel_cased_codable_enum
- return_value_from_void_function
- prefer_self_type_over_type_of_self
excluded:
- Carthage
- Pods
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: error
swiftgen_fonts:
name: "SwiftGen Fonts"
regex: 'UIFont(\.init)?\(name: ?"?.+"?, ?size:.+?\)'
message: "Use FontFamily.<family>.<variant>.size(<size>) instead"
severity: warning
swiftgen_storyboards:
name: "SwiftGen Storyboards"
regex: '(UIStoryboard\(name: ?"?.+"?, ?bundle:.+\))|(instantiateViewController\(withIdentifier:.+?\))|(instantiateInitialViewController\(\))'
message: "Use StoryboardScene.<storyboad>.<scene>.instantiate() instead"
severity: error
swiftgen_strings:
name: "SwiftGen Strings"
regex: 'NSLocalizedString'
message: "Use L10n.key instead"
severity: warning
swiftgen_storyboard_segue_perform:
name: "SwiftGen Storyboard Segue Identifier"
regex: 'performSegue\(withIdentifier: ?"?.+"?, ?sender:.+\)'
message: "Use perform(segue: StoryboardSegue.<storyboard>.<segue>, sender: <sender>) instead"
severity: warning