-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
executable file
·67 lines (52 loc) · 1.25 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
# paths to ignore during linting. Takes precedence over `included`.
excluded:
- Carthage/
- Pods/
# Rules
opt_in_rules:
- conditional_returns_on_newline
- fatal_error_message
- overridden_super_call
- closure_end_indentation
- closure_spacing
- empty_string
- explicit_init
- first_where
- joined_default_parameter
- multiline_parameters
- prohibited_super_call
- sorted_first_last
- untyped_error_in_catch
force_cast: error
force_try: error
colon:
apply_to_dictionaries: false
identifier_name:
excluded:
- id
- URL
- a
- b
statement_position:
statement_mode: uncuddled_else
# Constants
file_length:
warning: 1000
error: 1500
type_body_length:
warning: 800
error: 1000
line_length: 140
function_parameter_count: 4
type_name:
min_length: 2 # only warning
# Custom rules
custom_rules:
enum_cases_on_newline:
name: "Enum cases on newline"
regex: "^\\s*case[\\h\\S]*,(?![^(]*\\))[^:|,]+$"
message: "Enum cases should always start with a newline."
accessors_and_observers_on_newline:
name: "Property accessors and observers on newline"
regex: "^\\s*(get|set|didSet|willSet)[\\h\\S]\\{[\\h\\S]+$"
message: "Property accessors and observers should always start with a newline."