forked from openhab/openhab-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
100 lines (87 loc) · 1.95 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
opt_in_rules:
- sorted_imports
- empty_count
- redundant_type_annotation
- trailing_closure
- unused_import
- implicit_return
- multiline_function_chains
- anyobject_protocol
- array_init
- attributes
- closure_end_indentation
- closure_spacing
- reduce_boolean
- file_types_order
- type_contents_order
- private_outlet
- private_action
- prefer_self_type_over_type_of_self
- file_name
- computed_accessors_order
- empty_enum_arguments
- prefer_zero_over_explicit_init
disabled_rules: # rule identifiers to exclude from running
- force_cast
- todo
included:
- ./
excluded:
- ./fastlane
- ./OpenHABCore/.build
nesting:
type_level: 2
function_body_length:
warning: 300
error: 500
type_body_length:
warning: 450
error: 500
file_length:
warning: 1000
error: 150000
ignore_comment_only_lines: true
cyclomatic_complexity:
ignores_case_statements: true
warning: 18
error: 45
line_length:
warning: 250
error: 500
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
identifier_name:
allowed_symbols: "_"
min_length: 2
max_length:
warning: 90
error: 1000
excluded:
- id
- a
- b
- i
- v
private_outlet:
allow_private_set: true
custom_rules:
comments_space: # From https://github.com/brandenr/swiftlintconfig
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: warning
explicit_failure_calls:
name: “Avoid asserting ‘false’”
regex: ‘((assert|precondition)\(false)’
message: “Use assertionFailure() or preconditionFailure() instead.”
severity: warning
multiple_empty_lines:
name: "Multiple Empty Lines"
regex: '((?:\s*\n){3,})'
message: "There are too many line breaks"
severity: error
file_name:
suffix_pattern: "Extension?|\\+.*"
opening_brace:
allow_multiline_func: true