-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.swiftlint.yml
93 lines (87 loc) · 2.28 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
disabled_rules:
- closure_parameter_position
- cyclomatic_complexity
- file_length
- function_body_length
- function_parameter_count
- line_length
- orphaned_doc_comment
- redundant_discardable_let
- statement_position
- type_body_length
- vertical_whitespace
opt_in_rules:
- anonymous_argument_in_multiline_closure
- array_init
- closure_spacing
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- convenience_type
- empty_collection_literal
- empty_count
- empty_string
- empty_xctest_method
- extension_access_modifier
- fatal_error_message
- file_name
- file_name_no_space
- file_types_order
- first_where
- flatmap_over_map_reduce
- implicit_return
- implicitly_unwrapped_optional
- last_where
- legacy_multiple
- operator_usage_whitespace
- overridden_super_call
- prefer_nimble
- prefer_self_in_static_references
- prefixed_toplevel_constant
- prohibited_interface_builder
- redundant_type_annotation
- shorthand_optional_binding
- single_test_class
- sorted_first_last
- static_operator
- toggle_bool
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- yoda_condition
custom_rules:
print:
included: '.*\.swift'
name: 'Print'
regex: '\b(Swift\s*\.\s*)?print\b'
message: 'Prints should be removed'
severity: warning
state_access:
included: '.*\.swift'
name: 'State Access'
regex: '\b[a-zA-Z0-9]*(?i)(viewModel|useCase)(?-i)\s*\.\s*state'
message: 'State should be accessed via subscript'
severity: warning
test_naming:
included: '.*Tests\.swift'
name: 'Test Naming'
regex: '\bfunc\s+test(?![a-zA-Z0-9]+(_given[a-zA-Z0-9]+)?(_when[a-zA-Z0-9]+)?_then[a-zA-Z0-9]+\s*\(\))'
message: 'Tests should be named "testFunction_givenX_whenY_thenZ", with "given" and "when" being optional'
severity: warning
fatal_error:
included: '.*\.swift'
name: 'Fatal Error'
regex: '\b(Swift\s*\.\s*)?fatalError\b'
message: 'Fatal errors should be removed'
severity: warning
excluded:
- Snapshot/SnapshotHelper.swift
- Shared/Generated
identifier_name:
excluded:
- id
trailing_whitespace:
ignores_empty_lines: true
large_tuple:
warning: 3
error: 4