forked from alemar11/CoreDataPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
112 lines (96 loc) · 2.77 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
included:
- Sources
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- Tests
- Support
- docs
- build
disabled_rules: # rule identifiers to exclude from running
- fallthrough
#- large_tuple
- todo
- switch_case_alignment
cyclomatic_complexity:
- 15 #warning
- 20 #error
line_length:
- 200 #warning
- 250 #error
type_body_length:
- 700 #warning
- 1000 #error
file_length:
- 1000 #warning
- 1200 #error
function_body_length:
- 125 #warning
- 200 #error
type_name:
min_length: 3 # only warning
max_length: # warning and error
warning: 50
error: 50
identifier_name:
excluded:
- id
- i
- j
- k
large_tuple:
warning: 3
colon:
apply_to_dictionaries: false
indentation: 2
opt_in_rules: # some rules are only opt-in
- closure_end_indentation
- closure_spacing
- syntactic_sugar
- redundant_nil_coalescing
- number_separator
- sorted_imports
- overridden_super_call
- object_literal
- explicit_init
- first_where
- operator_usage_whitespace
number_separator:
minimum_length: 7
custom_rules:
explicit_failure_calls:
name: "Avoid asserting 'false'"
regex: '((assert|precondition)\(false)'
message: "Use assertionFailure() or preconditionFailure() instead."
severity: warning
double_space: # from https://github.com/IBM-Swift/Package-Builder
include: "*.swift"
name: "Double space"
regex: '([a-z,A-Z] \s+)'
message: "Double space between keywords"
match_kinds: keyword
severity: warning
comments_space: # from https://github.com/brandenr/swiftlintconfig
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: warning
empty_line_after_guard: # from https://github.com/brandenr/swiftlintconfig
name: "Empty Line After Guard"
regex: '(^ *guard[ a-zA-Z0-9=?.\(\),><!]*\{[ a-zA-Z0-9=?.\(\),><!]*\}\n *(?!(?:return|guard))\S+)'
message: "There should be an empty line after a guard"
severity: warning
unnecessary_type: # from https://github.com/brandenr/swiftlintconfig
name: "Unnecessary Type"
regex: '[ a-zA-Z0-9]*(?:let|var) [ a-zA-Z0-9]*: ([a-zA-Z0-9]*)[ ]*= \1'
message: "Type Definition Not Needed"
severity: warning
no_line_around_parentheses: # from https://github.com/realm/SwiftLint/issues/2213
regex: '\{\h*\R\h*\R|\R\h*\R\h*\}'
message: No scope should begin or end with an empty line.
no_objcMembers: # from https://github.com/airbnb/swift/blob/master/resources/swiftlint.yml
name: "@objcMembers"
regex: "@objcMembers"
message: "Explicitly use @objc on each member you want to expose to Objective-C"
severity: error
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji)