-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftlint.yml
131 lines (123 loc) · 3.45 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
included:
- Sources
- Tests
# Try to stay below 80
line_length:
warning: 100
error: 120
function_body_length:
warning: 25
error: 30
file_length:
warning: 250
error: 300
# This may seem like a lot, but basically I like to write some code
# and then enable all of the optional rules that do not break the project.
opt_in_rules:
- array_init
- attributes
- closure_end_indentation
- contains_over_first_not_nil
- empty_count
- explicit_init
- fatal_error_message
- first_where
# - implicit_return
- implicitly_unwrapped_optional
- joined_default_parameter
- literal_expression_end_indentation
- multiline_parameters
- nimble_operator
- number_separator
- overridden_super_call
- pattern_matching_keywords
- private_outlet
- prohibited_super_call
- quick_discouraged_call
- redundant_nil_coalescing
- single_test_class
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- anyobject_protocol
- closure_body_length
- closure_spacing
- collection_alignment
- convenience_type
- explicit_self
- discouraged_object_literal
- discouraged_optional_boolean
- discouraged_optional_collection
- empty_string
- empty_xctest_method
- explicit_enum_raw_value
- fallthrough
- file_header
- force_unwrapping
- function_default_parameter_at_end
- identical_operands
- legacy_random
- lower_acl_than_parent
- multiline_arguments
- multiline_function_chains
- multiline_literal_brackets
- object_literal
- override_in_extension
- private_action
- prohibited_interface_builder
- quick_discouraged_focused_test
- quick_discouraged_pending_test
- redundant_type_annotation
- required_enum_case
- sorted_first_last
- static_operator
- toggle_bool
- trailing_closure
- unavailable_function
- vertical_whitespace_closing_braces
- yoda_condition
- no_extension_access_modifier
- contains_over_filter_count
- contains_over_filter_is_empty
- empty_collection_literal
- last_where
- legacy_multiple
- modifier_order
- reduce_into
- unused_import
- unused_declaration
disabled_rules:
- identifier_name # annoying
- colon # align properties
- comma # align func params
- type_body_length # we are using 'file_length' rule
- opening_brace # if true { ... }
- statement_position # else { ... }
# Maybe later:
# - missing_docs
# Following optional rules are disabled:
# - strict_fileprivate # this one does not work properly?
# - explicit_acl # we don't need acl in tests
# - explicit_top_level_acl # this one requires us to put acl before 'extension XXX'
# - conditional_returns_on_newline
# - explicit_type_interface # this is weird
# - extension_access_modifier
# - file_name # we heavily use extensions for single type
# - file_types_order # declare helper type near usage
# - let_var_whitespace # weird, but does not trigger
# - multiline_arguments_brackets
# - multiline_parameters_brackets
# - no_grouping_extension
# - nslocalizedstring_key # is is not iOS
# - nslocalizedstring_require_bundle # is is not iOS
# - strong_iboutlet # is is not iOS
# - operator_usage_whitespace # sometimes we align stuff
# - prefixed_toplevel_constant
# - required_deinit
# - sorted_imports
# - switch_case_on_newline
# - type_contents_order
# - unowned_variable_capture
# - untyped_error_in_catch
# - vertical_whitespace_between_cases
# - vertical_whitespace_opening_braces
# - xct_specific_matcher