-
Notifications
You must be signed in to change notification settings - Fork 283
/
Copy path.rubocop.yml
218 lines (172 loc) · 4.53 KB
/
.rubocop.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
require: rubocop-performance
AllCops:
Exclude:
- 'vendor/**/*'
- 'gemfiles/vendor/**/*'
- 'spec/dummyapp/**/*'
- 'spec/tmp/**/*'
TargetRubyVersion: 2.5 # This is the minimum allowed for current rubocop
Gemspec/RequiredRubyVersion:
Enabled: false # rubocop compares to gemspec, yet won't allow 1.9 as minimum version
Layout/HeredocIndentation:
# When enabled, forces either squiggly syntax (not available until 2.3),
# or external packages that we don't want as dependencies.
Enabled: false
Layout/LineLength:
Max: 90
Lint/SendWithMixinArgument:
# Object#include is still a private method in Ruby 2.0.
Enabled: false
Metrics/BlockLength:
ExcludedMethods: ['describe', 'context'] # RSpec DSL is expected to have long blocks.
Metrics/MethodLength:
Max: 15 # Relax slightly from the default of 10
Naming/MethodParameterName:
# It's possible to configure this cop to allow just about anything, but what's the point.
# The default min length of a param name is 3, but the the default whitelist includes things
# like `db` and `io`. So, short names really can be useful.
Enabled: false
Style/CaseEquality:
# The code uses `===` a lot to compare a regex to a string, but it's not clear that
# switching to `=~` is always safe, because in some cases the value could be a regex
# or a string and `str1 =~ str2` isn't valid. Whoever enables this cop should carefully
# review and test each of these.
Enabled: false
Style/Documentation:
# We can enabled this if/when we want to start doing consistent class documentation.
# As is, we currently add :nodoc: if anything at all.
Enabled: false
Style/DoubleNegation:
Enabled: false
Style/EachWithObject:
Enabled: false
Style/Encoding:
Enabled: false # Ruby 1.9.3 needs these magic comments, e.g. # encoding: UTF-8
Style/ExpandPathArguments:
Enabled: false # syntax requires Ruby >= 2.0
Style/FrozenStringLiteralComment:
# If we do this, it will be in its own PR. It requires adding these magic comments
# throughout the project, in order to prepare for a future Ruby 3.x.
Enabled: false
Style/HashSyntax:
EnforcedStyle: no_mixed_keys
SupportedStyles:
- no_mixed_keys
Style/Lambda:
Enabled: false
Style/PercentLiteralDelimiters:
PreferredDelimiters:
# rubocop switched from () to [] at some past version.
# Make sure we are consistent across all bundles/builds.
default: '[]'
Style/RedundantBegin:
# Ruby < 2.5 needs begin/end inside blocks when using rescue
Enabled: false
Style/SafeNavigation:
# Not available in Ruby < 2.3.
Enabled: false
Style/SymbolArray:
Enabled: false # %i[] syntax isn't 1.9.x compatible
#
# Performance cops are opt in, and `Enabled: true` is always required.
# Full list is here: https://github.com/rubocop-hq/rubocop-performance/tree/master/lib/rubocop/cop/performance
# For travis builds, Codacy will see and use these directives.
#
Performance/Caller:
Enabled: true
Exclude:
- spec/**/*
Performance/CaseWhenSplat:
Enabled: true
Exclude:
- spec/**/*
Performance/Casecmp:
Enabled: true
Exclude:
- spec/**/*
Performance/ChainArrayAllocation:
Enabled: true
Exclude:
- spec/**/*
Performance/CompareWithBlock:
Enabled: true
Exclude:
- spec/**/*
Performance/Count:
Enabled: true
Exclude:
- spec/**/*
Performance/Detect:
Enabled: true
Exclude:
- spec/**/*
Performance/DoubleStartEndWith:
Enabled: true
Exclude:
- spec/**/*
Performance/EndWith:
Enabled: true
Exclude:
- spec/**/*
Performance/FixedSize:
Enabled: true
Exclude:
- spec/**/*
Performance/FlatMap:
Enabled: true
Exclude:
- spec/**/*
Performance/InefficientHashSearch:
Enabled: true
Exclude:
- spec/**/*
Performance/OpenStruct:
Enabled: true
Performance/RangeInclude:
Enabled: true
Exclude:
- spec/**/*
Performance/RedundantBlockCall:
Enabled: true
Exclude:
- spec/**/*
Performance/RedundantMatch:
Enabled: true
Exclude:
- spec/**/*
Performance/RedundantMerge:
Enabled: true
Exclude:
- spec/**/*
Performance/RegexpMatch:
Enabled: true
Exclude:
- spec/**/*
Performance/ReverseEach:
Enabled: true
Exclude:
- spec/**/*
Performance/Size:
Enabled: true
Exclude:
- spec/**/*
Performance/StartWith:
Enabled: true
Exclude:
- spec/**/*
Performance/StringReplacement:
Enabled: true
Exclude:
- spec/**/*
Performance/TimesMap:
Enabled: true
Exclude:
- spec/**/*
Performance/UnfreezeString:
Enabled: true
Exclude:
- spec/**/*
Performance/UriDefaultParser:
Enabled: true
Exclude:
- spec/**/*