-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
364 lines (291 loc) · 9.54 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# .rubocop.yml for non-RB101 courses (06 June 2023)
AllCops:
# Enable all new cops
NewCops: enable
# Display cop names
DisplayCopNames: true
# Display Extra details
ExtraDetails: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding DisplayStyleGuide, or by giving the
# -S/--display-style-guide option.
DisplayStyleGuide: true
# When specifying style guide URLs, any paths and/or fragments will be
# evaluated relative to the base URL.
StyleGuideBaseURL: https://rubystyle.guide/
# What version of the Ruby interpreter is the inspected code intended to
# run on? (If there is more than one, set this to the lowest version.)
TargetRubyVersion: 2.4
Style/BlockComments:
Description: "Do not use block comments."
Enabled: false
Style/ClassVars:
Description: "Checks for uses of class variables."
Enabled: false
Style/CommandLiteral:
Description: "Use `` or %x around command literals."
Enabled: true
# backticks: Always use backticks.
# percent_x: Always use %x.
# mixed: Use backticks on single-line commands, and %x on multi-line commands.
EnforcedStyle: mixed
SupportedStyles:
- backticks
- percent_x
- mixed
# If false, the cop will always recommend using %x if one or more backticks
# are found in the command string.
AllowInnerBackticks: false
Style/CommentAnnotation:
Description: >-
Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
Enabled: false
Style/Documentation:
Description: "Document classes and non-namespace modules."
Enabled: false
Style/DoubleNegation:
Description: "Checks for uses of double negation (!!)."
Enabled: false
Layout/EmptyLineBetweenDefs:
Enabled: true
AllowAdjacentOneLineDefs: true
Style/EmptyLiteral:
Description: Prefer literals to Array.new/Hash.new/String.new.
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Description: Require the addition of the frozen string literal comment.
Style/GuardClause:
Description: Check for conditionals that can be replaced with guard clauses.
Enabled: true
MinBodyLength: 1
Style/HashSyntax:
Description: >-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
Enabled: true
EnforcedStyle: ruby19_no_mixed_keys
UseHashRocketsWithSymbolValues: false
PreferHashRocketsForNonAlnumEndingSymbols: false
Style/IfUnlessModifier:
Description: >-
Favor modifier if/unless usage when you have a
single-line body.
Enabled: false
Style/InlineComment:
Description: Avoid inline comments.
Enabled: false
Style/MethodCallWithoutArgsParentheses:
Description: Do not use parentheses for method calls with no arguments.
Enabled: false
Style/ModuleFunction:
Description: Checks for usage of `extend self` in modules.
Enabled: false
Style/MutableConstant:
Description: Freeze mutable constants.
Enabled: false
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions
(or control flow or).
Enabled: false
Style/NegatedWhile:
Description: "Favor until over while for negative conditions."
Enabled: false
Style/Next:
Description: "Use `next` to skip iteration instead of a condition at the end."
Enabled: false
Style/NumericLiterals:
Description: Add underscores to large numeric literals to improve their readability.
Enabled: false
Style/NumericPredicate:
Description: >-
Checks for the use of predicate- or comparison methods for
numeric comparisons.
Enabled: false
Style/OneLineConditional:
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
Enabled: false
Naming/BinaryOperatorParameterName:
Description: When defining binary operators, name the argument other.
Enabled: false
Style/ParenthesesAroundCondition:
Description: >-
Don't use parentheses around the condition of an
if/unless/while.
Enabled: true
AllowSafeAssignment: false
Style/PercentLiteralDelimiters:
Description: "Use `%`-literal delimiters consistently"
Enabled: true
PreferredDelimiters:
"%": ()
"%i": ()
"%I": ()
"%q": ()
"%Q": ()
"%r": ()
"%s": ()
"%w": ()
"%W": ()
"%x": ()
Style/PerlBackrefs:
Description: Avoid Perl-style regex back references.
Enabled: false
Style/Proc:
Description: Use proc instead of Proc.new.
Enabled: false
Style/RedundantFetchBlock:
Description: Only way to keep FetchBlock warning from popping up.
Enabled: true
Style/RedundantParentheses:
Enabled: false
Style/RedundantReturn:
Description: "Don't use return where it's not required."
Enabled: true
# When true allows code like `return x, y`.
AllowMultipleReturnValues: true
Style/RegexpLiteral:
Description: "Use / or %r around regular expressions."
Enabled: true
EnforcedStyle: mixed
AllowInnerSlashes: false
Style/SafeNavigation:
Description: >-
This cop transforms usages of a method call safeguarded by
a check for the existance of the object to
safe navigation (`&.`).
Enabled: true
Style/SingleLineBlockParams:
Description: Enforces the names of some block params.
Enabled: false
Style/SingleLineMethods:
Description: Avoid single-line methods.
Enabled: false
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: false
Style/StringLiterals:
Description: Force use of single or double quotes when no interpolation
Enabled: false
Style/SymbolArray:
Description: "Use %i or %I for arrays of symbols."
StyleGuide: "#percent-i"
Enabled: false
Style/WhileUntilModifier:
Description: Favor modifier while/until usage when you have a single-line body.
Enabled: false
Style/WordArray:
Description: "Use %w or %W for arrays of words."
Enabled: false
Metrics/AbcSize:
Description: >-
A calculated magnitude based on number of assignments,
branches, and conditions.
Enabled: true
Max: 18
Metrics/BlockLength:
Description: Limit size of blocks.
Enabled: true
Max: 20
Metrics/ClassLength:
Description: "Avoid classes longer than 100 lines of code."
Enabled: false
Layout/LineLength:
Description: Limit lines to 80 characters.
Enabled: true
Max: 80
StyleGuide: https://rubystyle.guide/#80-character-limits
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
Description: "Avoid methods longer than 10 lines of code."
Enabled: true
CountComments: false # count full line comments?
Max: 10
Lint/LiteralInInterpolation:
Description: "Avoid interpolating literals in strings"
AutoCorrect: false
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Description: "Checks for a newline after an attribute accessor or a group of them."
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Description: "Checks method call operators to not have spaces around them."
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Description: "Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0. Prefer passing a string instead."
Enabled: false
Lint/MixedRegexpCaptureTypes:
Description: "Do not mix named captures and numbered captures"
Enabled: false
Lint/RaiseException:
Description: "Checks for raise or fail statements which are raising Exception class."
Enabled: false
Lint/StructNewOverride:
Description: "Checks unexpected overrides of the Struct built-in methods via Struct.new"
Enabled: false
Style/ExponentialNotation:
Description: "Enforces consistency when using exponential notation for numbers in the code"
Enabled: false
Style/HashTransformKeys:
Description: "Tries to use a simpler & faster call to transform_keys where possible"
Enabled: false
Style/HashTransformValues:
Description: "Tries to use a simpler & faster call to transform_values where possible"
Enabled: false
Style/RedundantRegexpCharacterClass:
Description: "Checks for unnecessary single-element Regexp character classes."
Enabled: false
Style/RedundantRegexpEscape:
Description: "Checks for redundant escapes inside Regexp literals"
Enabled: false
Style/SlicingWithRange:
Description: "Checks that arrays are sliced with endless ranges instead of ary[start..-1]"
Enabled: false
Layout/EmptyLineAfterGuardClause:
Description: "Requires empty line after guard clause"
Enabled: false
Style/FloatDivision:
Description: "Checks for division with integers coerced to floats."
Enabled: false
Naming/MethodParameterName:
Description: "Parameter names at least 3 characters long"
Enabled: false
Style/ConditionalAssignment:
Description: "Use return value of conditional for assignment"
Enabled: true
Naming/AccessorMethodName:
Description: "Do not prefix reader method names with get_"
Enabled: true
Style/NegatedUnless:
Description: "Favor if over unless"
Enabled: false
Style/MultipleComparison:
Description: "Avoid comparing variable with multiple items"
Enabled: false
Layout/HeredocIndentation:
Description: "Checks the indentation of the here document bodies"
Enabled: false
Layout/ClosingHeredocIndentation:
Description: "Checks the indentation of here document closings."
Enabled: false
Style/CommentedKeyword:
Description: "Comments should not be on same line as def"
Enabled: false
Style/FormatStringToken:
Description: "Prefer annotated tokens over unannotated"
Enabled: false
Style/HashEachMethods:
Description: "each_key over keys.each"
Enabled: false
Style/MultilineWhenThen:
Description: "Avoid then for multiline when statement"
Enabled: false
Style/InverseMethods:
Description: "reject instead of reversed select"
Enabled: false
Style/MixinGrouping:
Description: "mixins as separate statements"
Enabled: false