forked from stripe/stripe-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
106 lines (96 loc) · 2.46 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
# .swiftlint.yml
#
# Goals:
# - Decrease number of `disabled_rules` that we agree with as a team
# - Increase number of `opt_in_rules` that we agree with as a team
# - Increase number of `custom_rules` that we agree with as a team
# - Avoid rule customization unless increasing strictness that we agree with as a team
#
# Useful rules reference: https://github.com/realm/SwiftLint/blob/master/Rules.md
disabled_rules:
- cyclomatic_complexity # This finds some hairy methods
- file_length
- force_cast
- function_body_length # Interesting overlap between these violations and cyclomatic_complexity
- operator_whitespace
- todo
- type_body_length
- void_function_in_ternary
- force_try
- opening_brace
- closing_brace
- function_parameter_count
- multiple_closures_with_trailing_closure
- inclusive_language
- line_length
- xctfail_message
- no_fallthrough_only
- closure_parameter_position
# Rules to potentially enable in the future
- shorthand_operator
- for_where
- empty_count
- overridden_super_call
- redundant_string_enum_value
- class_delegate_protocol
- reduce_boolean
- unused_setter_value
- notification_center_detachment
- private_outlet
opt_in_rules:
- colon
- comma
- control_statement
# - force_unwrapping # Enable one day...
- joined_default_parameter
- leading_whitespace
- legacy_cggeometry_functions
- legacy_constant
- multiline_parameters
- overridden_super_call
- private_outlet
- prohibited_super_call
- redundant_nil_coalescing
- return_arrow_whitespace
- sorted_imports
- statement_position
- trailing_newline
- trailing_semicolon
- trailing_whitespace
- closure_spacing
# Rules to potentially enable in the future
# - weak_delegate
# - discouraged_object_literal
# - unowned_variable_capture
# - single_test_class
excluded:
- Package.swift
- Pods
- Carthage
- Tests/installation_tests
- vendor
- build*
- .build
identifier_name:
allowed_symbols: _
min_length: 1
max_length: 100
validates_start_with_lowercase: false
large_tuple:
warning: 4 # It would be nice to lower this number
error: 5
nesting:
type_level:
warning: 4
error: 5
type_name:
allowed_symbols: _`
min_length: 1
max_length: 100
validates_start_with_lowercase: false
vertical_whitespace:
max_empty_lines: 1
trailing_comma:
mandatory_comma: true
generic_type_name:
max_length: 30 # Maybe remove after initial cleanup.