-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.swiftlint.yml
127 lines (110 loc) · 2.31 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#
# SwiftLint configuration file
#
# Feel free to send pull request or suggest improvements!
#
#
# Rule identifiers to exclude from running.
#
disabled_rules:
- trailing_whitespace
- todo
- modifier_order
- statement_position
#
# Some rules are only opt-in. Find all the available rules by running: swiftlint rules
#
opt_in_rules:
- empty_count
- force_unwrapping
- conditional_returns_on_newline
- private_action
- private_outlet
- implicitly_unwrapped_optional
- empty_string
- extension_access_modifier
- closure_spacing
- fatal_error_message
- first_where
- toggle_bool
- unused_declaration
- modifier_order
- contains_over_first_not_nil
- convenience_type
- fallthrough
- unused_import
- unavailable_function
- strict_fileprivate
- explicit_init
- anyobject_protocol
#
# Paths to include during linting. `--path` is ignored if present.
#
included:
- Sources
#
# Paths to ignore during linting. Takes precedence over `included`.
#
excluded:
- Carthage
- Pods
- Tests
- Vendor
- Scripts
- fastlane
- R.generated.swift
- Package.swift
#
# Configure individual rules below.
#
vertical_whitespace:
max_empty_lines: 2
force_cast: error
identifier_name:
excluded:
- id
- by
- x
- y
empty_count: warning
line_length:
ignores_function_declarations: yes
ignores_comments: yes
ignores_urls: yes
error: 300
warning: 200
line_length:
error: 300
warning: 200
function_body_length:
error: 150
warning: 100
type_body_length:
error: 900
warning: 600
file_length:
error: 1000
warning: 700
function_parameter_count:
error: 9
warning: 8
# Custom rules definitions
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
force_https: # From https://github.com/Twigz/Game
name: "Force HTTPS over HTTP"
regex: "((?i)http(?!s))"
match_kinds: string
message: "HTTPS should be favored over HTTP"
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