-
Notifications
You must be signed in to change notification settings - Fork 0
/
.swiftlint.yml
86 lines (82 loc) · 2.42 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
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
- 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
comments_capitalized_ignore_possible_code:
name: "Capitalize First Word In Comment"
regex: '(^ +// +(?!swiftlint)[a-z]+)'
message: "The first word of a comment should be capitalized"
severity: error
empty_first_line:
name: "Empty First Line"
regex: '(^[ a-zA-Z ]*(?:protocol|extension|class|struct) (?!(?:var|let))[ a-zA-Z:]*\{\n *\S+)'
message: "There should be an empty line after a declaration"
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 - Problems with travis