-
Notifications
You must be signed in to change notification settings - Fork 1
/
.swiftlint.yml
executable file
·120 lines (102 loc) · 2.25 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
#
# SwiftLint configuration file commonly used in STRV (v 0.1.2)
#
# Feel free to send pull request or suggest improvements!
#
analyzer_rules:
- unused_import
#
# Rule identifiers to exclude from running.
#
disabled_rules:
#
# 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
- modifier_order
- contains_over_first_not_nil
- convenience_type
- fallthrough
- unavailable_function
- strict_fileprivate
- explicit_init
- redundant_objc_attribute
- unowned_variable_capture
- strong_iboutlet
#
# Paths to include during linting. `--path` is ignored if present.
#
included:
- NetworkingSampleApp
- Sources
- Tests
#
# Paths to ignore during linting. Takes precedence over `included`.
#
excluded:
- Carthage
- Pods
- Scripts
- vendor
- fastlane
- R.generated.swift
#
# Configure individual rules below.
#
vertical_whitespace:
max_empty_lines: 2
force_cast: error
identifier_name:
excluded:
- id
empty_count:
severity: warning
trailing_whitespace:
ignores_empty_lines: true
line_length:
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
error: 300
warning: 200
function_body_length:
error: 150
warning: 100
type_body_length:
error: 900
warning: 600
file_length:
error: 1000
warning: 700
# 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