-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.swiftlint.yml
More file actions
179 lines (157 loc) · 3.93 KB
/
Copy path.swiftlint.yml
File metadata and controls
179 lines (157 loc) · 3.93 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
disabled_rules:
# Disable purely cosmetic, non-Google length/complexity metrics
- attributes
- closure_parameter_position
- cyclomatic_complexity
- file_length
- function_body_length
- type_body_length
- nesting
- identifier_name
- opening_brace
- type_name
- function_parameter_count
- large_tuple
# Disable rules that contradict Google Style Guide
- explicit_acl
- explicit_top_level_acl
- explicit_self
- vertical_parameter_alignment # Google strictly forbids horizontal alignment
- pattern_matching_keywords # SwiftLint prefers "case let", Google explicitly forbids it
- fallthrough # Google allows fallthrough if block is not empty; SwiftLint forbids it completely
- todo
- file_header
opt_in_rules:
- array_init
- async_without_await
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- compiler_protocol_init
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- convenience_type
- direct_return
- discarded_notification_center_observer
- duplicate_imports
- empty_collection_literal
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fatal_error_message
- first_where
- flatmap_over_map_reduce
- force_unwrapping
- identical_operands
- implicit_return
- implicitly_unwrapped_optional
- incompatible_concurrency_annotation
- joined_default_parameter
- last_where
- legacy_multiple
- legacy_objc_type
- legacy_random
- local_doc_comment
- lower_acl_than_parent
- modifier_order
- multiline_arguments
- multiline_parameters
- operator_usage_whitespace
- overridden_super_call
- override_in_extension
- prefer_self_in_static_references
- prefer_self_type_over_type_of_self
- prefer_zero_over_explicit_init
- private_action
- private_outlet
- prohibited_super_call
- reduce_into
- redundant_nil_coalescing
- redundant_type_annotation
- redundant_void_return
- return_value_from_void_function
- self_binding
- shorthand_optional_binding
- sorted_first_last
- sorted_imports
- static_operator
- strict_fileprivate
- superfluous_else
- switch_case_alignment
- toggle_bool
- trailing_closure
- trailing_comma
- unavailable_function
- unhandled_throwing_task
- unneeded_parentheses_in_closure_argument
- unowned_variable_capture
- weak_delegate
- yoda_condition
analyzer_rules:
- capture_variable
- unused_declaration
- unused_import
# Google enforces rigid 100-character line limit
line_length:
warning: 100
error: 100
ignores_comments: true
ignores_urls: true
# Google enforces trailing commas on multi-line elements
trailing_comma:
mandatory_comma: true
# Google requires cases to NOT be indented relative to their switch statements
switch_case_alignment:
indented_cases: false
force_try:
severity: error
force_cast:
severity: error
force_unwrapping:
severity: error
implicitly_unwrapped_optional:
severity: error
unused_declaration:
severity: error
unused_import:
severity: error
trailing_whitespace:
severity: error
ignores_empty_lines: false
# Google permits multiple blank lines but doesn't encourage them.
# Capped to 2 to prevent messy files, but kept as a warning to avoid being overly cosmetic.
vertical_whitespace:
severity: warning
max_empty_lines: 2
comma:
severity: error
colon:
severity: error
apply_to_dictionaries: false
statement_position:
statement_mode: default
overridden_super_call:
severity: error
private_action:
severity: error
private_outlet:
severity: error
implicit_getter:
severity: error
last_where:
severity: warning
first_where:
severity: warning
empty_count:
severity: error
excluded:
- .build
- .swiftpm
- "**/Generated"
# DriverKit extension uses different APIs (NSString for IOKit) and formatting
# conventions (HID descriptor arrays prioritize readability over alignment)
reporter: "xcode"