forked from rosberry/ledger-ios
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftlint.yml
85 lines (68 loc) · 1.68 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
# paths to ignore during linting. Takes precedence over `included`.
excluded:
- Carthage
- Pods
disabled_rules:
- switch_case_alignment
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
- file_header
force_cast: error
force_try: error
colon:
apply_to_dictionaries: false
identifier_name:
excluded:
- x
- y
- id
- URL
- vk
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
type_contents_order:
order:
- case
- associated_type
- type_alias
- subtype
- [type_property, instance_property]
- [initializer, type_method, view_life_cycle_method, subscript, other_method, ib_action]
file_header:
required_pattern: |
\/\/
\/\/ Copyright © \d{4}\ .*?. All rights reserved.
\/\/
# 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."