-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.swiftlint.yml
119 lines (97 loc) · 2.47 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
#
# SwiftLint configuration file commonly used in STRV (v 0.1)
#
# Feel free to send pull request or suggest improvements!
#
#
# Rule identifiers to exclude from running.
#
disabled_rules:
- force_cast # TODO: remove this rule and fix it (use R.swift if possible)
- generic_type_name # TODO: remove this rule and fix code
- cyclomatic_complexity # TODO: remove this rule and fix code
- file_length # TODO: remove this rule and fix code
- todo
- for_where # TODO: remove this and fix code
- unused_optional_binding # TODO: remove this and fix code
- fallthrough
- shorthand_operator
- class_delegate_protocol
- discarded_notification_center_observer
- vertical_parameter_alignment
#
# Some rules are only opt-in. Find all the available rules by running: swiftlint rules
#
opt_in_rules:
- empty_count
#
# Paths to include during linting. `--path` is ignored if present.
#
included: ~
#
# Paths to ignore during linting. Takes precedence over `included`.
#
excluded:
- Carthage
- Pods
- MHDApp/R.generated.swift
- mhd widget/Support/R.generated.swift
- MHDApp/Common/_Libraries/Strongify/Strongify.swift
#
# Configure individual rules below.
#
vertical_whitespace:
max_empty_lines: 2
force_cast: warning
identifier_name:
excluded:
- id
- vc
- "n"
- to
- km
- ox
- up
- "no"
- my
- rC
- ok
empty_count: warning
trailing_whitespace:
ignores_empty_lines: true
line_length:
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
error: 300
warning: 290 # TODO: fix it back to 200
type_body_length: # TODO: remove this rule and fix code
error: 550
warning: 500
function_body_length: # TODO: remove this rule and fix code
warning: 60
statement_position:
statement_mode: uncuddled_else
reporter: "xcode"
#
# Place custom rules here.
#
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