-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path.swiftlint.yml
118 lines (113 loc) · 3.29 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
disabled_rules:
- identifier_name # Does not make sense to lint for the length of identifiers.
- type_name # Same as above.
- empty_enum_arguments # It warns about an explicit pattern we use.
- superfluous_disable_command # Disabled since we disable some rules pre-emptively to avoid issues in the future
- todo # Disabled while we are filling out the framework; re-enable when we get closer to completion
- nesting # Does not make sense anymore since Swift 4 uses nested `CodingKeys` enums for example
- implicit_return # Suddenly started firing for existing code on PRs, should investigate later
opt_in_rules:
- attributes
- closure_end_indentation
- closure_spacing
- collection_alignment
- colon
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- discouraged_object_literal
- empty_collection_literal
- empty_count
- empty_string
- explicit_init
- extension_access_modifier
- fatal_error_message
- file_header
- first_where
- identical_operands
- implicit_return
- joined_default_parameter
- literal_expression_end_indentation
- legacy_hashing
- legacy_random
- multiline_arguments
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- notification_center_detachment
- number_separator
- operator_usage_whitespace
- overridden_super_call
- private_action
- prohibited_interface_builder
- prohibited_super_call
- redundant_nil_coalescing
- redundant_objc_attribute
- single_test_class
- sorted_imports
- static_operator
- toggle_bool
- trailing_comma
- trailing_whitespace
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
- weak_delegate
- yoda_condition
excluded:
- .build
- build
- Carthage
- Other
- Tools
- Templates
attributes:
always_on_same_line:
- "@IBAction"
- "@NSManaged"
- "@objc"
closure_spacing: warning
empty_count:
severity: warning
fatal_error_message: warning
file_header:
severity: warning
forbidden_pattern: |
\/\/
\/\/ .*?\..*
\/\/ .*
\/\/
\/\/ Created by .*? on .*\.
\/\/ Copyright © \d{4} .*\. All rights reserved\.
\/\/
force_cast: warning
force_try: warning
implicit_getter: warning
indentation: 4 # 4 spaces
line_length:
warning: 200 # our line length is 120 chars, sometimes surpassing that is fine
error: 200
ignores_function_declarations: true
multiline_arguments:
first_argument_location: next_line
number_separator:
minimum_length: 5 # number of digits, i.e. >= 10_000
redundant_nil_coalescing: warning
shorthand_operator: warning
trailing_comma:
mandatory_comma: true
vertical_whitespace:
max_empty_lines: 2
weak_delegate: warning
cyclomatic_complexity:
warning: 12
function_parameter_count:
warning: 7
reporter:
- "xcode"
- "junit"
custom_rules:
associated_values_unwrapping:
name: "Associated Value Unwrapping"
regex: "case let [a-zA-Z0-9]*.[a-zA-Z0-9]+\\([a-zA-Z0-9 ,]+"
message: "Each associated value should be defined as a separate constant (i.e: .enumCase(let val1, let val2))"
severity: warning