rubocop-gusto 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -0
- data/LICENSE +21 -0
- data/README.md +53 -0
- data/config/default.yml +781 -0
- data/config/rails.yml +122 -0
- data/exe/gusto-rubocop +12 -0
- data/exe/rubocop-gusto +9 -0
- data/lib/rubocop/cop/gusto/bootsnap_load_file.rb +57 -0
- data/lib/rubocop/cop/gusto/datadog_constant.rb +16 -0
- data/lib/rubocop/cop/gusto/execute_migration.rb +16 -0
- data/lib/rubocop/cop/gusto/factory_classes_or_modules.rb +19 -0
- data/lib/rubocop/cop/gusto/min_by_max_by.rb +45 -0
- data/lib/rubocop/cop/gusto/no_metaprogramming.rb +131 -0
- data/lib/rubocop/cop/gusto/no_rescue_error_message_checking.rb +66 -0
- data/lib/rubocop/cop/gusto/no_send.rb +32 -0
- data/lib/rubocop/cop/gusto/object_in.rb +36 -0
- data/lib/rubocop/cop/gusto/paperclip_or_attachable.rb +17 -0
- data/lib/rubocop/cop/gusto/perform_class_method.rb +73 -0
- data/lib/rubocop/cop/gusto/polymorphic_type_validation.rb +89 -0
- data/lib/rubocop/cop/gusto/prefer_process_last_status.rb +35 -0
- data/lib/rubocop/cop/gusto/rabl_extends.rb +43 -0
- data/lib/rubocop/cop/gusto/rails_env.rb +72 -0
- data/lib/rubocop/cop/gusto/rake_constants.rb +68 -0
- data/lib/rubocop/cop/gusto/regexp_bypass.rb +90 -0
- data/lib/rubocop/cop/gusto/sidekiq_params.rb +21 -0
- data/lib/rubocop/cop/gusto/toplevel_constants.rb +55 -0
- data/lib/rubocop/cop/gusto/use_paint_not_colorize.rb +240 -0
- data/lib/rubocop/cop/gusto/vcr_recordings.rb +49 -0
- data/lib/rubocop/cop/internal_affairs/assignment_first.rb +56 -0
- data/lib/rubocop/cop/internal_affairs/require_restrict_on_send.rb +62 -0
- data/lib/rubocop/gusto/cli.rb +22 -0
- data/lib/rubocop/gusto/config_yml.rb +135 -0
- data/lib/rubocop/gusto/init.rb +59 -0
- data/lib/rubocop/gusto/plugin.rb +29 -0
- data/lib/rubocop/gusto/templates/rubocop.yml +25 -0
- data/lib/rubocop/gusto/version.rb +7 -0
- data/lib/rubocop/gusto.rb +9 -0
- data/lib/rubocop-gusto.rb +13 -0
- metadata +178 -0
data/config/default.yml
ADDED
@@ -0,0 +1,781 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-performance
|
4
|
+
- rubocop-rake
|
5
|
+
|
6
|
+
# After you add a rule, sort this file with `bundle exec rubocop-gusto sort config/default.yml`
|
7
|
+
|
8
|
+
AllCops:
|
9
|
+
TargetRubyVersion: <%= RbConfig::CONFIG['RUBY_API_VERSION'] %>
|
10
|
+
MaxFilesInCache: 100000
|
11
|
+
Exclude:
|
12
|
+
- './.[!.]*' # ignore all dotfiles
|
13
|
+
- './.[!.]*/**/*' # ignore all dot directories
|
14
|
+
- 'config/boot.rb'
|
15
|
+
- 'db/**/*schema.rb'
|
16
|
+
- 'db/seeds{.rb,/**/*}'
|
17
|
+
DisplayCopNames: true
|
18
|
+
NewCops: disable
|
19
|
+
SuggestExtensions: false
|
20
|
+
|
21
|
+
Bundler/OrderedGems:
|
22
|
+
ConsiderPunctuation: true
|
23
|
+
|
24
|
+
FactoryBot/FactoryClassName:
|
25
|
+
Include:
|
26
|
+
- '**/factories/**/*'
|
27
|
+
- '**/factories.rb'
|
28
|
+
|
29
|
+
FactoryBot/NoClassesOrModules:
|
30
|
+
Include:
|
31
|
+
- '**/spec/**/factories/*'
|
32
|
+
|
33
|
+
Gemspec/RequiredRubyVersion:
|
34
|
+
# We don't want to enforce a Ruby version in each gemspec and gemfile for inline gems.
|
35
|
+
# This rule is not helpful for apps with inlined gems, as we upgrade everything at once.
|
36
|
+
# We manage our Ruby version in our version file and import that to our Gemfile.
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Gusto/BootsnapLoadFile:
|
40
|
+
Description: 'Do not use Bootsnap to load files. Use `require` instead.'
|
41
|
+
|
42
|
+
Gusto/DatadogConstant:
|
43
|
+
Exclude:
|
44
|
+
# calling DataDog directly only allowed in initializers, its library, and tests
|
45
|
+
- 'config/application.rb'
|
46
|
+
- 'config/initializers/datadog.rb'
|
47
|
+
- 'lib/datadog/**/*'
|
48
|
+
- '**/spec/**/*'
|
49
|
+
Description: 'Do not call Datadog directly, use an appropriate wrapper library.'
|
50
|
+
|
51
|
+
Gusto/ExecuteMigration:
|
52
|
+
Description: "Don't use `execute` in migrations. Use a backfill rake task instead."
|
53
|
+
Include:
|
54
|
+
- 'db/migrate/*.rb'
|
55
|
+
|
56
|
+
Gusto/FactoryClassesOrModules:
|
57
|
+
Description: 'Do not define modules or classes in factory directories - they break reloading.'
|
58
|
+
Include:
|
59
|
+
- 'spec/**/factories/*.rb'
|
60
|
+
|
61
|
+
Gusto/MinByMaxBy:
|
62
|
+
Description: 'Checks for the use of `min` or `max` with a proc. Corrects to `min_by` or `max_by`.'
|
63
|
+
Safe: false
|
64
|
+
Severity: error
|
65
|
+
|
66
|
+
Gusto/NoMetaprogramming:
|
67
|
+
Description: 'Avoid using metaprogramming techniques like define_method and instance_eval which make code harder to understand and debug.'
|
68
|
+
|
69
|
+
Gusto/NoRescueErrorMessageChecking:
|
70
|
+
Description: 'Checks for the presence of error message checking within rescue blocks.'
|
71
|
+
|
72
|
+
Gusto/NoSend:
|
73
|
+
Description: 'Do not call a private method via `__send__`.'
|
74
|
+
|
75
|
+
Gusto/ObjectIn:
|
76
|
+
Description: 'Use `Range#cover?` instead of `Object#in?`.'
|
77
|
+
Safe: false
|
78
|
+
|
79
|
+
Gusto/PaperclipOrAttachable:
|
80
|
+
Description: 'No more new paperclip or Attachable are allowed. Use ActiveStorage instead.'
|
81
|
+
|
82
|
+
Gusto/PerformClassMethod:
|
83
|
+
Description: 'Prevents accidental definition of `perform` class methods (should be instance methods instead).'
|
84
|
+
# List of modules that include Sidekiq::Worker.
|
85
|
+
# Add your other base modules here if they include Sidekiq::Worker too.
|
86
|
+
WorkerModules:
|
87
|
+
- Sidekiq::Worker
|
88
|
+
|
89
|
+
Gusto/PolymorphicTypeValidation:
|
90
|
+
Description: 'Ensures that polymorphic relations include a type validation, which is necessary for generating Sorbet types.'
|
91
|
+
|
92
|
+
Gusto/PreferProcessLastStatus:
|
93
|
+
Description: 'Prefer using `Process.last_status` instead of the global variables: `$?` and `$CHILD_STATUS`.'
|
94
|
+
|
95
|
+
Gusto/RablExtends:
|
96
|
+
Description: 'Disallows the use of `extends` in Rabl templates due to poor caching performance. Inline the templating to generate your JSON instead.'
|
97
|
+
Include:
|
98
|
+
- '**/*.json.rabl'
|
99
|
+
|
100
|
+
Gusto/RailsEnv:
|
101
|
+
Description: 'Use Feature Flags or config instead of `Rails.env`.'
|
102
|
+
|
103
|
+
Gusto/RakeConstants:
|
104
|
+
Description: 'Do not define a constant in rake file, because they are sometimes `load`ed, instead of `require`d which can lead to warnings about redefining constants.'
|
105
|
+
Include:
|
106
|
+
- '**/*.rake'
|
107
|
+
- 'Rakefile'
|
108
|
+
|
109
|
+
Gusto/RegexpBypass:
|
110
|
+
Description: 'Ensures regular expressions use \A and \z anchors instead of ^ and $ for security validation.'
|
111
|
+
Exclude:
|
112
|
+
- '**/spec/**/*'
|
113
|
+
Safe: false
|
114
|
+
|
115
|
+
Gusto/SidekiqParams:
|
116
|
+
Description: 'Sidekiq perform methods cannot take keyword arguments.'
|
117
|
+
|
118
|
+
Gusto/ToplevelConstants:
|
119
|
+
Description: 'Prevents top-level constants from being defined outside of initializers.'
|
120
|
+
Include:
|
121
|
+
- '**/*.rb'
|
122
|
+
Exclude:
|
123
|
+
- '**/bin/*'
|
124
|
+
- 'bin/*'
|
125
|
+
- 'config/**/*'
|
126
|
+
- 'lib/*.rb'
|
127
|
+
- 'packs/**/{db/seeds,lib,config/initializers}/**/*'
|
128
|
+
- 'script/**/*'
|
129
|
+
- 'spec/rails_helper.rb'
|
130
|
+
- '**/spec/support/**/*'
|
131
|
+
- '**/*/spec_helper.rb'
|
132
|
+
- 'spec/support/**/*.rb'
|
133
|
+
|
134
|
+
Gusto/UsePaintNotColorize:
|
135
|
+
Description: 'Use Paint instead of colorize for terminal colors.'
|
136
|
+
|
137
|
+
Gusto/VcrRecordings:
|
138
|
+
Description: 'VCR should be set to not record in tests. Use vcr: {record: :none}.'
|
139
|
+
|
140
|
+
Layout/BlockAlignment:
|
141
|
+
EnforcedStyleAlignWith: start_of_block
|
142
|
+
|
143
|
+
Layout/CaseIndentation:
|
144
|
+
EnforcedStyle: end
|
145
|
+
IndentOneStep: false
|
146
|
+
|
147
|
+
Layout/DotPosition:
|
148
|
+
Enabled: true
|
149
|
+
# We use the (default) leading dot position for Sorbet and IDE compatibility.
|
150
|
+
EnforcedStyle: leading
|
151
|
+
|
152
|
+
Layout/EmptyLineAfterGuardClause:
|
153
|
+
Enabled: true
|
154
|
+
|
155
|
+
Layout/EmptyLineAfterMagicComment:
|
156
|
+
Enabled: true
|
157
|
+
|
158
|
+
Layout/EmptyLineBetweenDefs:
|
159
|
+
AllowAdjacentOneLineDefs: true
|
160
|
+
|
161
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
162
|
+
Enabled: false
|
163
|
+
|
164
|
+
Layout/EmptyLinesAroundClassBody:
|
165
|
+
EnforcedStyle: no_empty_lines
|
166
|
+
|
167
|
+
Layout/EmptyLinesAroundModuleBody:
|
168
|
+
EnforcedStyle: no_empty_lines
|
169
|
+
|
170
|
+
Layout/EndAlignment:
|
171
|
+
EnforcedStyleAlignWith: start_of_line
|
172
|
+
|
173
|
+
Layout/ExtraSpacing:
|
174
|
+
AllowForAlignment: true
|
175
|
+
|
176
|
+
Layout/FirstArgumentIndentation:
|
177
|
+
EnforcedStyle: consistent
|
178
|
+
|
179
|
+
Layout/FirstArrayElementIndentation:
|
180
|
+
EnforcedStyle: consistent
|
181
|
+
|
182
|
+
Layout/FirstArrayElementLineBreak:
|
183
|
+
Enabled: true
|
184
|
+
|
185
|
+
Layout/FirstHashElementIndentation:
|
186
|
+
EnforcedStyle: consistent
|
187
|
+
|
188
|
+
Layout/FirstHashElementLineBreak:
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
Layout/FirstMethodArgumentLineBreak:
|
192
|
+
Enabled: true
|
193
|
+
|
194
|
+
Layout/FirstMethodParameterLineBreak:
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Layout/LineLength:
|
198
|
+
# TODO: Pick some maximum like 200 to start with
|
199
|
+
Enabled: false
|
200
|
+
|
201
|
+
Layout/MultilineArrayBraceLayout:
|
202
|
+
EnforcedStyle: symmetrical
|
203
|
+
|
204
|
+
Layout/MultilineAssignmentLayout:
|
205
|
+
Enabled: false
|
206
|
+
|
207
|
+
Layout/MultilineHashBraceLayout:
|
208
|
+
EnforcedStyle: symmetrical
|
209
|
+
|
210
|
+
Layout/MultilineMethodCallBraceLayout:
|
211
|
+
EnforcedStyle: symmetrical
|
212
|
+
|
213
|
+
Layout/MultilineMethodCallIndentation:
|
214
|
+
EnforcedStyle: indented
|
215
|
+
|
216
|
+
Layout/MultilineMethodDefinitionBraceLayout:
|
217
|
+
EnforcedStyle: symmetrical
|
218
|
+
|
219
|
+
Layout/MultilineOperationIndentation:
|
220
|
+
EnforcedStyle: indented
|
221
|
+
|
222
|
+
Layout/ParameterAlignment:
|
223
|
+
EnforcedStyle: with_fixed_indentation
|
224
|
+
|
225
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
226
|
+
Enabled: true
|
227
|
+
|
228
|
+
Layout/SpaceAroundMethodCallOperator:
|
229
|
+
Enabled: true
|
230
|
+
|
231
|
+
Layout/SpaceInLambdaLiteral:
|
232
|
+
EnforcedStyle: require_space
|
233
|
+
|
234
|
+
Lint/AmbiguousBlockAssociation:
|
235
|
+
Enabled: true
|
236
|
+
Exclude:
|
237
|
+
- '**/spec/**/*'
|
238
|
+
|
239
|
+
Lint/EmptyFile:
|
240
|
+
Enabled: true
|
241
|
+
|
242
|
+
Lint/EnsureReturn:
|
243
|
+
Enabled: true
|
244
|
+
|
245
|
+
Lint/RaiseException:
|
246
|
+
Enabled: true
|
247
|
+
|
248
|
+
Lint/SelfAssignment:
|
249
|
+
Severity: error
|
250
|
+
|
251
|
+
Lint/SharedMutableDefault:
|
252
|
+
Enabled: true
|
253
|
+
|
254
|
+
Lint/StructNewOverride:
|
255
|
+
Enabled: false
|
256
|
+
|
257
|
+
Lint/UnexpectedBlockArity:
|
258
|
+
Enabled: true
|
259
|
+
Severity: error
|
260
|
+
|
261
|
+
Lint/UnusedMethodArgument:
|
262
|
+
AllowUnusedKeywordArguments: true
|
263
|
+
|
264
|
+
Lint/UselessConstantScoping:
|
265
|
+
Enabled: true
|
266
|
+
|
267
|
+
Lint/Void:
|
268
|
+
Severity: error
|
269
|
+
|
270
|
+
Metrics/AbcSize:
|
271
|
+
Enabled: false
|
272
|
+
|
273
|
+
Metrics/BlockLength:
|
274
|
+
Enabled: false
|
275
|
+
|
276
|
+
Metrics/ClassLength:
|
277
|
+
Enabled: true
|
278
|
+
Max: 2500
|
279
|
+
|
280
|
+
Metrics/CyclomaticComplexity:
|
281
|
+
Enabled: false
|
282
|
+
|
283
|
+
Metrics/MethodLength:
|
284
|
+
Enabled: false
|
285
|
+
|
286
|
+
Metrics/ModuleLength:
|
287
|
+
Enabled: false
|
288
|
+
|
289
|
+
Metrics/PerceivedComplexity:
|
290
|
+
Enabled: false
|
291
|
+
|
292
|
+
Naming/AccessorMethodName:
|
293
|
+
Enabled: false
|
294
|
+
|
295
|
+
Naming/MethodParameterName:
|
296
|
+
Enabled: false
|
297
|
+
|
298
|
+
Naming/PredicatePrefix:
|
299
|
+
# Dropping the predicate can make code less understandable.
|
300
|
+
# For example, `is_foo?` and `has_foo?` have different semantics,
|
301
|
+
# but this rule would suggest they both be renamed `foo?`.
|
302
|
+
Enabled: false
|
303
|
+
|
304
|
+
Naming/RescuedExceptionsVariableName:
|
305
|
+
Enabled: false
|
306
|
+
|
307
|
+
Naming/VariableNumber:
|
308
|
+
Enabled: false
|
309
|
+
|
310
|
+
Performance/CollectionLiteralInLoop:
|
311
|
+
Enabled: true
|
312
|
+
|
313
|
+
Performance/OpenStruct:
|
314
|
+
Enabled: true
|
315
|
+
|
316
|
+
Performance/RedundantBlockCall:
|
317
|
+
# Disable this cop because we often declare blocks arguments for Sorbet sigs.
|
318
|
+
Enabled: false
|
319
|
+
|
320
|
+
Performance/ZipWithoutBlock:
|
321
|
+
Enabled: true
|
322
|
+
|
323
|
+
RSpec:
|
324
|
+
Include:
|
325
|
+
- '**/spec/**/*'
|
326
|
+
|
327
|
+
RSpec/ContainExactly:
|
328
|
+
Enabled: false
|
329
|
+
|
330
|
+
RSpec/ContextWording:
|
331
|
+
Enabled: true
|
332
|
+
|
333
|
+
RSpec/DescribeClass:
|
334
|
+
Enabled: false
|
335
|
+
|
336
|
+
RSpec/DescribeMethod:
|
337
|
+
Enabled: false
|
338
|
+
|
339
|
+
RSpec/DescribedClass:
|
340
|
+
Enabled: false
|
341
|
+
|
342
|
+
RSpec/DescribedClassModuleWrapping:
|
343
|
+
Enabled: true
|
344
|
+
# TODO: improve this file matching pattern
|
345
|
+
Include:
|
346
|
+
- '**/spec/**/*_spec.rb'
|
347
|
+
|
348
|
+
RSpec/ExampleLength:
|
349
|
+
Enabled: false
|
350
|
+
|
351
|
+
RSpec/ExampleWording:
|
352
|
+
Enabled: false
|
353
|
+
|
354
|
+
RSpec/ExpectChange:
|
355
|
+
# Disable this cop because there's issues for either styles:
|
356
|
+
# If `method_call` style, chained expectations (.by) does not work with `.by`.
|
357
|
+
# If `block style, https://github.com/rubocop/rubocop/issues/7486.
|
358
|
+
Enabled: false
|
359
|
+
|
360
|
+
RSpec/ExpectInHook:
|
361
|
+
Enabled: false
|
362
|
+
|
363
|
+
RSpec/IndexedLet:
|
364
|
+
Enabled: false
|
365
|
+
|
366
|
+
RSpec/IteratedExpectation:
|
367
|
+
Enabled: true
|
368
|
+
|
369
|
+
RSpec/LeadingSubject:
|
370
|
+
Enabled: true
|
371
|
+
|
372
|
+
RSpec/LetSetup:
|
373
|
+
Enabled: false
|
374
|
+
|
375
|
+
RSpec/MatchArray:
|
376
|
+
Enabled: false
|
377
|
+
|
378
|
+
RSpec/MessageChain:
|
379
|
+
# This limits our use of the RSpec API with no real benefit
|
380
|
+
Enabled: false
|
381
|
+
|
382
|
+
RSpec/MessageSpies:
|
383
|
+
Enabled: false
|
384
|
+
|
385
|
+
RSpec/MultipleExpectations:
|
386
|
+
Enabled: false
|
387
|
+
|
388
|
+
RSpec/MultipleMemoizedHelpers:
|
389
|
+
Enabled: false
|
390
|
+
|
391
|
+
RSpec/NamedSubject:
|
392
|
+
Enabled: false
|
393
|
+
|
394
|
+
RSpec/NestedGroups:
|
395
|
+
Enabled: false
|
396
|
+
|
397
|
+
RSpec/NoExpectationExample:
|
398
|
+
# Too many false positives. Even if we carefully set the AllowedPatterns config, there's not enough benefit.
|
399
|
+
Enabled: false
|
400
|
+
|
401
|
+
RSpec/NotToNot:
|
402
|
+
Enabled: false
|
403
|
+
|
404
|
+
RSpec/PredicateMatcher:
|
405
|
+
Enabled: false
|
406
|
+
|
407
|
+
RSpec/ReceiveMessages:
|
408
|
+
Enabled: false
|
409
|
+
|
410
|
+
RSpec/ScatteredSetup:
|
411
|
+
AutoCorrect: false
|
412
|
+
|
413
|
+
RSpec/SpecFilePathFormat:
|
414
|
+
Enabled: true
|
415
|
+
|
416
|
+
RSpec/SpecFilePathSuffix:
|
417
|
+
Enabled: true
|
418
|
+
|
419
|
+
RSpec/StubbedMock:
|
420
|
+
Enabled: false
|
421
|
+
|
422
|
+
RSpec/SubjectStub:
|
423
|
+
Enabled: false
|
424
|
+
|
425
|
+
Rake/ClassDefinitionInTask:
|
426
|
+
Enabled: false
|
427
|
+
|
428
|
+
Rake/Desc:
|
429
|
+
# TODO: Roll this out.
|
430
|
+
Enabled: true
|
431
|
+
|
432
|
+
Security/YAMLLoad:
|
433
|
+
Enabled: true
|
434
|
+
|
435
|
+
Sorbet:
|
436
|
+
# TODO: validate these choices for Harmonization
|
437
|
+
# BindingConstantWithoutTypeAlias
|
438
|
+
# EnforceSigilOrder # verify this works with Teams annotations
|
439
|
+
# ForbidUntypedStructProps
|
440
|
+
# SignatureBuildOrder
|
441
|
+
Enabled: true
|
442
|
+
|
443
|
+
Sorbet/FalseSigil:
|
444
|
+
# We want to avoid `typed: ignore` as much as possible, as it breaks LSP tooling.
|
445
|
+
Include:
|
446
|
+
- "**/*.{rb,rbi,rake,ru}"
|
447
|
+
Exclude:
|
448
|
+
- bin/**/*
|
449
|
+
- db/**/*.rb
|
450
|
+
- script/**/*
|
451
|
+
|
452
|
+
Sorbet/Refinement:
|
453
|
+
# Still marked pending upstream, we contributed this and enable it here.
|
454
|
+
Enabled: true
|
455
|
+
|
456
|
+
Sorbet/StrictSigil:
|
457
|
+
# Forgot the difference between typed levels? (ignore, false, true, strict, and strong)
|
458
|
+
# Check this out: https://sorbet.org/docs/static#file-level-granularity-strictness-levels
|
459
|
+
Enabled: true
|
460
|
+
|
461
|
+
Sorbet/ValidSigil:
|
462
|
+
Enabled: true
|
463
|
+
RequireSigilOnAllFiles: true
|
464
|
+
# We don't want to require any specific typed level at this point – only that there IS a typed sigil.
|
465
|
+
MinimumStrictness: ignore
|
466
|
+
# We do suggest that the user type their file as `typed: strict`
|
467
|
+
SuggestedStrictness: strict
|
468
|
+
Exclude:
|
469
|
+
- '**/spec/**/*'
|
470
|
+
- '**/db/migrate/**/*'
|
471
|
+
- '**/*.{rake,arb,erb,rabl}'
|
472
|
+
- '**/{Gemfile,Rakefile}'
|
473
|
+
|
474
|
+
Style/AccessorGrouping:
|
475
|
+
Enabled: false
|
476
|
+
|
477
|
+
Style/Alias:
|
478
|
+
Enabled: true
|
479
|
+
EnforcedStyle: prefer_alias_method
|
480
|
+
|
481
|
+
Style/AsciiComments:
|
482
|
+
# TODO: roll this out fully
|
483
|
+
Enabled: true
|
484
|
+
|
485
|
+
Style/AutoResourceCleanup:
|
486
|
+
Enabled: true
|
487
|
+
|
488
|
+
Style/BlockDelimiters:
|
489
|
+
EnforcedStyle: line_count_based
|
490
|
+
AllowedMethods:
|
491
|
+
- it
|
492
|
+
- expect
|
493
|
+
- change
|
494
|
+
|
495
|
+
Style/ClassAndModuleChildren:
|
496
|
+
# TODO: will this make our code safer? is it okay to use?
|
497
|
+
# https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/ClassAndModuleChildren
|
498
|
+
# EnforcedStyle: compact
|
499
|
+
Enabled: false
|
500
|
+
|
501
|
+
Style/CollectionMethods:
|
502
|
+
Enabled: false
|
503
|
+
|
504
|
+
Style/CommandLiteral:
|
505
|
+
# This cop Style/CommandLiteral protects us from accidentally using backticks for strings quotes.
|
506
|
+
# Forcing the use of %x() should make it more obvious visually where the command literals are.
|
507
|
+
# This is easy to miss, but is a bug-without-test-failures at best and an opportunity for an
|
508
|
+
# attack vector at worst.
|
509
|
+
Enabled: true
|
510
|
+
EnforcedStyle: percent_x
|
511
|
+
|
512
|
+
Style/ConditionalAssignment:
|
513
|
+
EnforcedStyle: assign_inside_condition
|
514
|
+
IncludeTernaryExpressions: false
|
515
|
+
|
516
|
+
Style/Documentation:
|
517
|
+
Enabled: false
|
518
|
+
|
519
|
+
Style/DoubleNegation:
|
520
|
+
Enabled: false
|
521
|
+
|
522
|
+
Style/EmptyElse:
|
523
|
+
Enabled: false
|
524
|
+
|
525
|
+
Style/EmptyMethod:
|
526
|
+
EnforcedStyle: expanded
|
527
|
+
|
528
|
+
Style/ExpandPathArguments:
|
529
|
+
Exclude:
|
530
|
+
- '**/bin/*'
|
531
|
+
|
532
|
+
Style/ExponentialNotation:
|
533
|
+
Enabled: true
|
534
|
+
|
535
|
+
Style/FormatString:
|
536
|
+
Enabled: false
|
537
|
+
|
538
|
+
Style/FormatStringToken:
|
539
|
+
EnforcedStyle: template
|
540
|
+
|
541
|
+
Style/FrozenStringLiteralComment:
|
542
|
+
EnforcedStyle: always
|
543
|
+
Enabled: true
|
544
|
+
|
545
|
+
Style/GuardClause:
|
546
|
+
Enabled: false
|
547
|
+
MinBodyLength: 4
|
548
|
+
|
549
|
+
Style/HashEachMethods:
|
550
|
+
Enabled: true
|
551
|
+
|
552
|
+
Style/HashSyntax:
|
553
|
+
EnforcedStyle: ruby19_no_mixed_keys
|
554
|
+
|
555
|
+
Style/HashTransformKeys:
|
556
|
+
Enabled: false
|
557
|
+
|
558
|
+
Style/HashTransformValues:
|
559
|
+
Enabled: false
|
560
|
+
|
561
|
+
Style/IfInsideElse:
|
562
|
+
Enabled: false
|
563
|
+
|
564
|
+
Style/IfUnlessModifier:
|
565
|
+
Enabled: false
|
566
|
+
|
567
|
+
Style/ImplicitRuntimeError:
|
568
|
+
Enabled: false
|
569
|
+
|
570
|
+
Style/InverseMethods:
|
571
|
+
Enabled: false
|
572
|
+
|
573
|
+
Style/Lambda:
|
574
|
+
EnforcedStyle: literal
|
575
|
+
|
576
|
+
Style/LambdaCall:
|
577
|
+
Enabled: false
|
578
|
+
|
579
|
+
Style/MethodCallWithArgsParentheses:
|
580
|
+
IgnoreMacros: true
|
581
|
+
AllowedMethods:
|
582
|
+
# Ruby
|
583
|
+
- puts
|
584
|
+
- raise
|
585
|
+
- fail
|
586
|
+
- exit
|
587
|
+
- sleep
|
588
|
+
# Rails
|
589
|
+
- render
|
590
|
+
- redirect_to
|
591
|
+
- authorize!
|
592
|
+
# Code loading
|
593
|
+
- require
|
594
|
+
- require_relative
|
595
|
+
- require_dependency
|
596
|
+
- load
|
597
|
+
# Bundler
|
598
|
+
- gem
|
599
|
+
- ruby
|
600
|
+
- source
|
601
|
+
# Rspec
|
602
|
+
- it
|
603
|
+
- describe
|
604
|
+
- context
|
605
|
+
- to
|
606
|
+
- not_to
|
607
|
+
- to_not
|
608
|
+
- be
|
609
|
+
- be_a
|
610
|
+
- be_an
|
611
|
+
- be_between
|
612
|
+
- be_falsey
|
613
|
+
- be_kind_of
|
614
|
+
- be_instance_of
|
615
|
+
- be_truthy
|
616
|
+
- be_within
|
617
|
+
- eq
|
618
|
+
- eql
|
619
|
+
- end_with
|
620
|
+
- include
|
621
|
+
- match
|
622
|
+
- raise_error
|
623
|
+
- respond_to
|
624
|
+
- start_with
|
625
|
+
# Rake
|
626
|
+
- task
|
627
|
+
# Gem
|
628
|
+
- add_dependency
|
629
|
+
- add_development_dependency
|
630
|
+
# Grape
|
631
|
+
- resources
|
632
|
+
- params
|
633
|
+
- requires
|
634
|
+
- desc
|
635
|
+
- optional
|
636
|
+
- get
|
637
|
+
- post
|
638
|
+
- put
|
639
|
+
- delete
|
640
|
+
# ActiveAdmin
|
641
|
+
- belongs_to
|
642
|
+
- sidebar
|
643
|
+
- action_item
|
644
|
+
- member_action
|
645
|
+
- page_action
|
646
|
+
- active_admin_form_for
|
647
|
+
- h1
|
648
|
+
- h2
|
649
|
+
- h3
|
650
|
+
- h4
|
651
|
+
- register
|
652
|
+
- register_page
|
653
|
+
- index
|
654
|
+
- column
|
655
|
+
- humanized_column
|
656
|
+
- panel
|
657
|
+
- attributes_table_for
|
658
|
+
- table_for
|
659
|
+
- row
|
660
|
+
- columns
|
661
|
+
- div
|
662
|
+
- span
|
663
|
+
- para
|
664
|
+
- text_node
|
665
|
+
# fields.
|
666
|
+
- input
|
667
|
+
- action
|
668
|
+
|
669
|
+
Style/MethodCalledOnDoEndBlock:
|
670
|
+
Enabled: false
|
671
|
+
|
672
|
+
Style/MissingElse:
|
673
|
+
Enabled: false
|
674
|
+
|
675
|
+
Style/ModuleFunction:
|
676
|
+
# Sorbet does not enforce the singleton version of module function methods: https://github.com/sorbet/sorbet/issues/8531
|
677
|
+
# Even if did, requiring the code to typecheck both paths would be a pain for maintainability.
|
678
|
+
# Also, it's better for the code to be explicit about which version of the method is being called,
|
679
|
+
# as it is one fewer decision the downstream developer has to make.
|
680
|
+
Enabled: true
|
681
|
+
EnforcedStyle: forbidden
|
682
|
+
|
683
|
+
Style/MultilineBlockChain:
|
684
|
+
# Disabled in Standard https://github.com/standardrb/standard/blob/main/config/base.yml#L1431
|
685
|
+
Enabled: false
|
686
|
+
|
687
|
+
Style/MultipleComparison:
|
688
|
+
Enabled: false
|
689
|
+
|
690
|
+
Style/NegatedIf:
|
691
|
+
Enabled: false
|
692
|
+
|
693
|
+
Style/Next:
|
694
|
+
Enabled: false
|
695
|
+
|
696
|
+
Style/NumericPredicate:
|
697
|
+
Enabled: false
|
698
|
+
|
699
|
+
Style/OptionHash:
|
700
|
+
Enabled: false
|
701
|
+
|
702
|
+
Style/OptionalBooleanParameter:
|
703
|
+
AllowedMethods:
|
704
|
+
- respond_to_missing?
|
705
|
+
- perform # Sidekiq does not support keyword arguments.
|
706
|
+
|
707
|
+
Style/PercentLiteralDelimiters:
|
708
|
+
PreferredDelimiters:
|
709
|
+
default: '()'
|
710
|
+
'%i': ()
|
711
|
+
'%I': ()
|
712
|
+
'%r': ()
|
713
|
+
'%w': ()
|
714
|
+
'%W': ()
|
715
|
+
|
716
|
+
Style/RaiseArgs:
|
717
|
+
Enabled: true
|
718
|
+
|
719
|
+
Style/RedundantSelf:
|
720
|
+
Enabled: false
|
721
|
+
|
722
|
+
Style/RegexpLiteral:
|
723
|
+
Enabled: false
|
724
|
+
|
725
|
+
Style/RescueStandardError:
|
726
|
+
Enabled: true
|
727
|
+
AutoCorrect: true
|
728
|
+
EnforcedStyle: 'implicit'
|
729
|
+
|
730
|
+
Style/Send:
|
731
|
+
Enabled: true
|
732
|
+
|
733
|
+
Style/SingleLineBlockParams:
|
734
|
+
Enabled: false
|
735
|
+
|
736
|
+
Style/SlicingWithRange:
|
737
|
+
Enabled: false
|
738
|
+
|
739
|
+
Style/SpecialGlobalVars:
|
740
|
+
Enabled: true
|
741
|
+
|
742
|
+
Style/StringLiterals:
|
743
|
+
Enabled: false
|
744
|
+
|
745
|
+
Style/StringMethods:
|
746
|
+
Enabled: true
|
747
|
+
|
748
|
+
Style/SymbolArray:
|
749
|
+
Enabled: false
|
750
|
+
|
751
|
+
Style/SymbolProc:
|
752
|
+
Enabled: true
|
753
|
+
|
754
|
+
Style/TernaryParentheses:
|
755
|
+
Enabled: false
|
756
|
+
EnforcedStyle: require_parentheses_when_complex
|
757
|
+
|
758
|
+
Style/TrailingCommaInArguments:
|
759
|
+
Enabled: true
|
760
|
+
EnforcedStyleForMultiline: no_comma # matches Standard https://github.com/standardrb/standard/blob/250b306cd44bea509d20023d9ab63170da67c815/config/base.yml#L1857
|
761
|
+
|
762
|
+
Style/TrailingCommaInArrayLiteral:
|
763
|
+
Enabled: true
|
764
|
+
EnforcedStyleForMultiline: consistent_comma
|
765
|
+
|
766
|
+
Style/TrailingCommaInHashLiteral:
|
767
|
+
Enabled: true
|
768
|
+
EnforcedStyleForMultiline: consistent_comma
|
769
|
+
|
770
|
+
Style/TrivialAccessors:
|
771
|
+
IgnoreClassMethods: true
|
772
|
+
|
773
|
+
Style/WhileUntilModifier:
|
774
|
+
Enabled: false
|
775
|
+
|
776
|
+
Style/WordArray:
|
777
|
+
Enabled: false
|
778
|
+
|
779
|
+
Style/YodaCondition:
|
780
|
+
# Be cautious, the correction is not functionally identical
|
781
|
+
Enabled: false
|