-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.swiftlint.yml
More file actions
126 lines (116 loc) · 3.09 KB
/
.swiftlint.yml
File metadata and controls
126 lines (116 loc) · 3.09 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
disabled_rules:
- trailing_comma
- nesting
- fallthrough
- shorthand_operator
- todo
- large_tuple
- identifier_name
- type_name
- line_length
- file_length
- unused_closure_parameter
- multiple_closures_with_trailing_closure
opt_in_rules:
- closure_end_indentation
- closure_spacing
- empty_count
- explicit_init
- fatal_error_message
- first_where
- implicit_return
- joined_default_parameter
- literal_expression_end_indentation
- overridden_super_call
- prohibited_super_call
- sorted_first_last
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- yoda_condition
- nslocalizedstring_key
- unused_setter_value
- optional_enum_case_matching
- prefer_self_type_over_type_of_self
- contains_over_range_nil_comparison
- flatmap_over_map_reduce
- empty_collection_literal
- contains_over_first_not_nil
- contains_over_filter_count
- contains_over_filter_is_empty
- reduce_into
- no_extension_access_modifier
- implicit_optional_initialization
- attributes
- closure_body_length
- collection_alignment
- comma_inheritance
- direct_return
- discouraged_assert
- discouraged_object_literal
- empty_string
- force_unwrapping
- last_where
- let_var_whitespace
- modifier_order
- multiline_arguments
- multiline_arguments_brackets
- multiline_function_chains
- nimble_operator
- no_magic_numbers
- number_separator
- operator_usage_whitespace
- pattern_matching_keywords
- period_spacing
- prefer_nimble
- prefer_zero_over_explicit_init
- prohibited_interface_builder
- raw_value_for_camel_cased_codable_enum
- redundant_nil_coalescing
- redundant_type_annotation
- return_value_from_void_function
- shorthand_optional_binding
- static_operator
- superfluous_else
- toggle_bool
- unhandled_throwing_task
- untyped_error_in_catch
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
force_try: warning
force_cast: warning
unhandled_throwing_task: warning
no_extension_access_modifier: warning
function_body_length: 80
cyclomatic_complexity: 12
function_parameter_count: 7
implicit_return:
included:
- closure
closure_body_length:
warning: 100
error: 1000
number_separator:
minimum_length: 5
custom_rules:
comment_whitespace:
name: "Comment Whitespace"
regex: //\S
match_kinds: comment
message: "Comments must begin with a whitespace character"
spaces_not_tabs:
name: "Spaces not Tabs"
regex: ^\t
message: "Use four spaces, not tabs"
# SwiftLint custom rules are regex-based; keep this targeted to obvious static constants.
static_var_constant:
name: "Static Var Constant"
regex: '\b(?:public|internal|private|fileprivate|open)?\s*(?:static|class)\s+var\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*[^=\n{]+\{\s*(?:Self\s*\(|\.[A-Za-z_][A-Za-z0-9_]*\b(?!\s*\()|"(?:[^"\\]|\\.)*"|[0-9]+|true|false|nil)'
message: "Use static let for constants instead of static var"
severity: warning
analyzer_rules:
- unused_import
- capture_variable
- typesafe_array_init
- unused_declaration
excluded:
- "**/*/.build"