-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
118 lines (118 loc) · 2.67 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
line_length:
warning: 150
error: 150
ignores_comments: true
file_length:
warning: 500
error: 1000
type_body_length:
warning: 300
error: 350
nesting:
type_level: 6
generic_type_name:
max_length: 30
identifier_name:
min_length:
error: 3
max_length:
warning: 100
error: 100
excluded:
- id
- fn
- v1
- v2
- io
type_name:
min_length:
warning: 2
error: 1
excluded:
- Id
- V1
- V2
cyclomatic_complexity:
warning: 12
error: 14
disabled_rules:
- function_parameter_count
- large_tuple
- multiple_closures_with_trailing_closure
excluded:
- .build
- DerivedData
opt_in_rules: # some rules are only opt-in
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_first_not_nil
- convenience_type
- discouraged_optional_boolean
- discouraged_optional_collection
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- fatal_error_message
# - file_types_order
- first_where
- identical_operands
- implicit_return
- joined_default_parameter
- last_where
- legacy_random
- literal_expression_end_indentation
- lower_acl_than_parent
# - missing_docs
- modifier_order
- multiline_arguments
- multiline_literal_brackets
- multiline_parameters
- no_extension_access_modifier
- nslocalizedstring_key
- number_separator
- object_literal
- operator_usage_whitespace
- overridden_super_call
- override_in_extension
- pattern_matching_keywords
- private_action
- private_outlet
- prohibited_interface_builder
# - reduce_into
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- sorted_imports
- strong_iboutlet
- toggle_bool
# - type_contents_order
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unused_import
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- xct_specific_matcher
- yoda_condition
custom_rules:
double_space: # from https://github.com/IBM-Swift/Package-Builder
include: "*.swift"
name: "Double space"
regex: '([a-z,A-Z] \s+)'
message: "Double space between keywords"
match_kinds: keyword
severity: warning
comments_space: # from https://github.com/brandenr/swiftlintconfig
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: warning
unnecessary_type: # from https://github.com/brandenr/swiftlintconfig
name: "Unnecessary Type"
regex: '[ a-zA-Z0-9]*(?:let|var) [ a-zA-Z0-9]*: ([a-zA-Z0-9]*)[ ]*= \1'
message: "Type Definition Not Needed"
severity: error