-
Notifications
You must be signed in to change notification settings - Fork 2
/
.swiftlint.yml
77 lines (73 loc) · 2.08 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
disabled_rules: # rule identifiers to exclude from running
- todo # This rule is handled by a separate build phase step.
- line_length
- trailing_whitespace
- statement_position
- opening_brace
- file_length # This rule counts white space and comments. Re-enabled when we've fixed it to not do that.
- nesting
opt_in_rules: # some rules are only opt-in
- missing_docs # There's currently a bug with the missing_docs rule resulting in false warnings. https://github.com/realm/SwiftLint/issues/811
- empty_count
- force_unwrapping
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- Vendor
- build
# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: error
force_try: error
force_unwrapping: error
variable_name:
max_length:
warning: 55
error: 60
min_length:
error: 4
excluded:
- row
- key
- id
- url
- uri
- db
- bar
- red
- lhs
- rhs
- tag
- rs
- URI
- URL
trailing_newline: error
comma: error
colon: error
opening_brace: error
empty_count: error
legacy_constructor: error
statement_position: error
legacy_constant: error
trailing_semicolon: error
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
custom_rules:
comments_space:
name: "Space After Comment"
regex: '(^ *//\w+)'
message: "There should be a space after //"
severity: error
empty_line_after_guard:
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: error
empty_line_after_super:
name: "Empty Line After Super"
regex: '(^ *super\.[ a-zA-Z0-9=?.\(\)\{\}:,><!]*\n *(?!(?:\}|return))\S+)'
message: "There should be an empty line after super"
severity: error
multiple_empty_lines:
name: "Multiple Empty Lines"
regex: '((?:\s*\n){3,})'
message: "There are too many line breaks"
severity: error