-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
.swiftlint.yml
118 lines (107 loc) · 2.53 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
# SwiftLint configuration
# Rule directory: https://realm.github.io/SwiftLint/rule-directory.html
# GitHub: https://github.com/realm/SwiftLint
excluded:
- Pods
- docs
- build
- scripts
- swiftpm
- .bundle
- vendor
opt_in_rules:
# performance
- empty_count
- first_where
- sorted_first_last
- contains_over_first_not_nil
- last_where
- reduce_into
- contains_over_filter_count
- contains_over_filter_is_empty
- empty_collection_literal
- final_test_case
# idiomatic
- fatal_error_message
- xctfail_message
- discouraged_object_literal
- discouraged_optional_boolean
- discouraged_optional_collection
- for_where
- function_default_parameter_at_end
- legacy_random
- no_extension_access_modifier
- redundant_type_annotation
- static_operator
- toggle_bool
- unavailable_function
- no_space_in_method_call
- discouraged_assert
- legacy_objc_type
- file_name
- file_name_no_space
- discouraged_none_name
- return_value_from_void_function
- prefer_zero_over_explicit_init
- shorthand_optional_binding
- xct_specific_matcher
- unneeded_synthesized_initializer
- static_over_final_class
- prefer_key_path
- no_empty_block
# style
- attributes
- number_separator
- operator_usage_whitespace
- sorted_imports
- vertical_parameter_alignment_on_call
- void_return
- closure_spacing
- empty_enum_arguments
- implicit_return
- modifier_order
- multiline_arguments
- multiline_parameters
- trailing_closure
- unneeded_parentheses_in_closure_argument
- vertical_whitespace_between_cases
- prefer_self_in_static_references
- comma_inheritance
- direct_return
- period_spacing
- superfluous_else
- sorted_enum_cases
- non_overridable_class_declaration
# lint
- overridden_super_call
- override_in_extension
- yoda_condition
- array_init
- empty_xctest_method
- identical_operands
- prohibited_super_call
- duplicate_enum_cases
- legacy_multiple
- accessibility_label_for_image
- lower_acl_than_parent
- unhandled_throwing_task
- private_swiftui_state
- non_optional_string_data_conversion
# Rules run by `swiftlint analyze` (experimental)
analyzer_rules:
# - unused_import
- unused_declaration
- explicit_self
- capture_variable
line_length: 200
file_length: 600
type_body_length: 500
function_body_length: 250
cyclomatic_complexity: 10
nesting:
type_level: 2
function_level: 2
check_nesting_in_closures_and_statements: true
always_allow_one_type_in_functions: false
identifier_name:
allowed_symbols: ['_']