rubomatic 0.0.1.pre.rc.2 → 0.0.1.pre.rc.3

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.
data/configs/rails.yml ADDED
@@ -0,0 +1,1054 @@
1
+ require: rubocop-rails
2
+
3
+ Rails/ActionControllerFlashBeforeRender:
4
+ Description: 'Use `flash.now` instead of `flash` before `render`.'
5
+ StyleGuide: 'https://rails.rubystyle.guide/#flash-before-render'
6
+ Reference: 'https://api.rubyonrails.org/classes/ActionController/FlashBeforeRender.html'
7
+ Enabled: true
8
+ SafeAutoCorrect: false
9
+ VersionAdded: '2.16'
10
+
11
+ Rails/ActionControllerTestCase:
12
+ Description: 'Use `ActionDispatch::IntegrationTest` instead of `ActionController::TestCase`.'
13
+ StyleGuide: 'https://rails.rubystyle.guide/#integration-testing'
14
+ Reference: 'https://api.rubyonrails.org/classes/ActionController/TestCase.html'
15
+ Enabled: true
16
+ SafeAutoCorrect: false
17
+ VersionAdded: '2.14'
18
+ Include:
19
+ - '**/test/**/*.rb'
20
+
21
+ Rails/ActionFilter:
22
+ Description: 'Enforces consistent use of action filter methods.'
23
+ Enabled: true
24
+ VersionAdded: '0.19'
25
+ EnforcedStyle: action
26
+ SupportedStyles:
27
+ - action
28
+ - filter
29
+ Include:
30
+ - app/controllers/**/*.rb
31
+ - app/mailers/**/*.rb
32
+
33
+ Rails/ActionOrder:
34
+ Description: 'Enforce consistent ordering of controller actions.'
35
+ Enabled: false
36
+ VersionAdded: '2.17'
37
+ ExpectedOrder:
38
+ - index
39
+ - show
40
+ - new
41
+ - edit
42
+ - create
43
+ - update
44
+ - destroy
45
+ Include:
46
+ - app/controllers/**/*.rb
47
+
48
+ Rails/ActiveRecordAliases:
49
+ Description: >-
50
+ Avoid Active Record aliases:
51
+ Use `update` instead of `update_attributes`.
52
+ Use `update!` instead of `update_attributes!`.
53
+ Enabled: true
54
+ VersionAdded: '0.53'
55
+ SafeAutoCorrect: false
56
+
57
+ Rails/ActiveRecordCallbacksOrder:
58
+ Description: 'Order callback declarations in the order in which they will be executed.'
59
+ StyleGuide: 'https://rails.rubystyle.guide/#callbacks-order'
60
+ Enabled: true
61
+ VersionAdded: '2.7'
62
+ Include:
63
+ - app/models/**/*.rb
64
+
65
+ Rails/ActiveRecordOverride:
66
+ Description: >-
67
+ Check for overriding Active Record methods instead of using
68
+ callbacks.
69
+ Enabled: true
70
+ VersionAdded: '0.67'
71
+ Include:
72
+ - app/models/**/*.rb
73
+
74
+ Rails/ActiveSupportAliases:
75
+ Description: >-
76
+ Avoid ActiveSupport aliases of standard ruby methods:
77
+ `String#starts_with?`, `String#ends_with?`,
78
+ `Array#append`, `Array#prepend`.
79
+ Enabled: true
80
+ VersionAdded: '0.48'
81
+
82
+ Rails/ActiveSupportOnLoad:
83
+ Description: 'Use `ActiveSupport.on_load(...)` to patch Rails framework classes.'
84
+ Enabled: true
85
+ Reference:
86
+ - 'https://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html'
87
+ - 'https://guides.rubyonrails.org/engines.html#available-load-hooks'
88
+ SafeAutoCorrect: false
89
+ VersionAdded: '2.16'
90
+
91
+ Rails/AddColumnIndex:
92
+ Description: >-
93
+ Rails migrations don't make use of a given `index` key, but also
94
+ doesn't given an error when it's used, so it makes it seem like an
95
+ index might be used.
96
+ Enabled: true
97
+ VersionAdded: '2.11'
98
+ Include:
99
+ - db/migrate/*.rb
100
+
101
+ Rails/AfterCommitOverride:
102
+ Description: >-
103
+ Enforces that there is only one call to `after_commit`
104
+ (and its aliases - `after_create_commit`, `after_update_commit`,
105
+ and `after_destroy_commit`) with the same callback name per model.
106
+ Enabled: true
107
+ VersionAdded: '2.8'
108
+
109
+ Rails/ApplicationController:
110
+ Description: 'Check that controllers subclass ApplicationController.'
111
+ Enabled: true
112
+ SafeAutoCorrect: false
113
+ VersionAdded: '2.4'
114
+ VersionChanged: '2.5'
115
+
116
+ Rails/ApplicationJob:
117
+ Description: 'Check that jobs subclass ApplicationJob.'
118
+ Enabled: true
119
+ SafeAutoCorrect: false
120
+ VersionAdded: '0.49'
121
+ VersionChanged: '2.5'
122
+
123
+ Rails/ApplicationMailer:
124
+ Description: 'Check that mailers subclass ApplicationMailer.'
125
+ Enabled: true
126
+ SafeAutoCorrect: false
127
+ VersionAdded: '2.4'
128
+ VersionChanged: '2.5'
129
+
130
+ Rails/ApplicationRecord:
131
+ Description: 'Check that models subclass ApplicationRecord.'
132
+ Enabled: true
133
+ SafeAutoCorrect: false
134
+ VersionAdded: '0.49'
135
+ VersionChanged: '2.5'
136
+
137
+ Rails/ArelStar:
138
+ Description: 'Enforces `Arel.star` instead of `"*"` for expanded columns.'
139
+ Enabled: true
140
+ SafeAutoCorrect: false
141
+ VersionAdded: '2.9'
142
+
143
+ Rails/AssertNot:
144
+ Description: 'Use `assert_not` instead of `assert !`.'
145
+ Enabled: true
146
+ VersionAdded: '0.56'
147
+ Include:
148
+ - '**/test/**/*'
149
+
150
+ Rails/AttributeDefaultBlockValue:
151
+ Description: 'Pass method call in block for attribute option `default`.'
152
+ Enabled: true
153
+ VersionAdded: '2.9'
154
+ Include:
155
+ - 'app/models/**/*'
156
+
157
+ Rails/BelongsTo:
158
+ Description: >-
159
+ Use `optional: true` instead of `required: false` for
160
+ `belongs_to` relations.
161
+ Enabled: true
162
+ VersionAdded: '0.62'
163
+
164
+ Rails/Blank:
165
+ Description: 'Enforces use of `blank?`.'
166
+ Enabled: true
167
+ SafeAutoCorrect: false
168
+ VersionAdded: '0.48'
169
+ VersionChanged: '2.10'
170
+ # Convert usages of `nil? || empty?` to `blank?`
171
+ NilOrEmpty: true
172
+ # Convert usages of `!present?` to `blank?`
173
+ NotPresent: true
174
+ # Convert usages of `unless present?` to `if blank?`
175
+ UnlessPresent: true
176
+
177
+ Rails/BulkChangeTable:
178
+ Description: 'Check whether alter queries are combinable.'
179
+ Enabled: true
180
+ VersionAdded: '0.57'
181
+ Database: null
182
+ SupportedDatabases:
183
+ - mysql
184
+ - postgresql
185
+ Include:
186
+ - db/migrate/*.rb
187
+
188
+ Rails/CompactBlank:
189
+ Description: 'Checks if collection can be blank-compacted with `compact_blank`.'
190
+ Enabled: true
191
+ Safe: false
192
+ VersionAdded: '2.13'
193
+
194
+ Rails/ContentTag:
195
+ Description: 'Use `tag.something` instead of `tag(:something)`.'
196
+ Reference:
197
+ - 'https://github.com/rubocop/rubocop-rails/issues/260'
198
+ - 'https://github.com/rails/rails/issues/25195'
199
+ - 'https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag'
200
+ Enabled: true
201
+ VersionAdded: '2.6'
202
+ VersionChanged: '2.12'
203
+ # This `Exclude` config prevents false positives for `tag` calls to `has_one: tag` and Puma configuration:
204
+ # https://puma.io/puma/Puma/DSL.html#tag-instance_method
205
+ # No helpers are used in normal models and configs.
206
+ Exclude:
207
+ - app/models/**/*.rb
208
+ - config/**/*.rb
209
+
210
+ Rails/CreateTableWithTimestamps:
211
+ Description: >-
212
+ Checks the migration for which timestamps are not included
213
+ when creating a new table.
214
+ Enabled: true
215
+ VersionAdded: '0.52'
216
+ Include:
217
+ - db/migrate/*.rb
218
+ Exclude:
219
+ # Respect the `active_storage_variant_records` table of `*_create_active_storage_tables.active_storage.rb`
220
+ # auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified.
221
+ - db/migrate/*_create_active_storage_tables.active_storage.rb
222
+
223
+ Rails/Date:
224
+ Description: >-
225
+ Checks the correct usage of date aware methods,
226
+ such as Date.today, Date.current etc.
227
+ Enabled: true
228
+ VersionAdded: '0.30'
229
+ VersionChanged: '2.11'
230
+ # The value `strict` disallows usage of `Date.today`, `Date.current`,
231
+ # `Date#to_time` etc.
232
+ # The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
233
+ # (but not `Date.today`) which are overridden by ActiveSupport to handle current
234
+ # time zone.
235
+ EnforcedStyle: strict
236
+ SupportedStyles:
237
+ - strict
238
+ - flexible
239
+ AllowToTime: false
240
+
241
+ Rails/DefaultScope:
242
+ Description: 'Avoid use of `default_scope`.'
243
+ StyleGuide: 'https://rails.rubystyle.guide#avoid-default-scope'
244
+ Enabled: true
245
+ VersionAdded: '2.7'
246
+
247
+ Rails/Delegate:
248
+ Description: 'Prefer delegate method for delegations.'
249
+ Enabled: true
250
+ VersionAdded: '0.21'
251
+ VersionChanged: '0.50'
252
+ # When set to true, using the target object as a prefix of the
253
+ # method name without using the `delegate` method will be a
254
+ # violation. When set to false, this case is legal.
255
+ EnforceForPrefixed: true
256
+
257
+ Rails/DelegateAllowBlank:
258
+ Description: 'Do not use allow_blank as an option to delegate.'
259
+ Enabled: true
260
+ VersionAdded: '0.44'
261
+
262
+ Rails/DeprecatedActiveModelErrorsMethods:
263
+ Description: 'Avoid manipulating ActiveModel errors hash directly.'
264
+ Enabled: true
265
+ Safe: false
266
+ VersionAdded: '2.14'
267
+ VersionChanged: '2.15'
268
+
269
+ Rails/DotSeparatedKeys:
270
+ Description: 'Enforces the use of dot-separated keys instead of `:scope` options in `I18n` translation methods.'
271
+ StyleGuide: 'https://rails.rubystyle.guide/#dot-separated-keys'
272
+ Enabled: true
273
+ VersionAdded: '2.15'
274
+
275
+ Rails/DuplicateAssociation:
276
+ Description: "Don't repeat associations in a model."
277
+ Enabled: true
278
+ VersionAdded: '2.14'
279
+
280
+ Rails/DuplicateScope:
281
+ Description: 'Multiple scopes share this same where clause.'
282
+ Enabled: true
283
+ VersionAdded: '2.14'
284
+
285
+ Rails/DurationArithmetic:
286
+ Description: 'Do not use duration as arithmetic operand with `Time.current`.'
287
+ StyleGuide: 'https://rails.rubystyle.guide#duration-arithmetic'
288
+ Enabled: true
289
+ VersionAdded: '2.13'
290
+
291
+ Rails/DynamicFindBy:
292
+ Description: 'Use `find_by` instead of dynamic `find_by_*`.'
293
+ StyleGuide: 'https://rails.rubystyle.guide#find_by'
294
+ Enabled: true
295
+ Safe: false
296
+ VersionAdded: '0.44'
297
+ VersionChanged: '2.10'
298
+ # The `Whitelist` has been deprecated, Please use `AllowedMethods` instead.
299
+ Whitelist:
300
+ - find_by_sql
301
+ - find_by_token_for
302
+ AllowedMethods:
303
+ - find_by_sql
304
+ - find_by_token_for
305
+ AllowedReceivers:
306
+ - Gem::Specification
307
+ - page # Prevents a warning for `page.find_by_id`. See: https://github.com/rubocop/rubocop-rails/issues/778
308
+
309
+ Rails/EagerEvaluationLogMessage:
310
+ Description: 'Checks that blocks are used for interpolated strings passed to `Rails.logger.debug`.'
311
+ Reference: 'https://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance'
312
+ Enabled: true
313
+ VersionAdded: '2.11'
314
+
315
+ Rails/EnumHash:
316
+ Description: 'Prefer hash syntax over array syntax when defining enums.'
317
+ StyleGuide: 'https://rails.rubystyle.guide#enums'
318
+ Enabled: true
319
+ VersionAdded: '2.3'
320
+ Include:
321
+ - app/models/**/*.rb
322
+
323
+ Rails/EnumUniqueness:
324
+ Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
325
+ Enabled: true
326
+ VersionAdded: '0.46'
327
+ Include:
328
+ - app/models/**/*.rb
329
+
330
+ Rails/EnvironmentComparison:
331
+ Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`."
332
+ Enabled: true
333
+ VersionAdded: '0.52'
334
+
335
+ Rails/EnvironmentVariableAccess:
336
+ Description: 'Do not access `ENV` directly after initialization.'
337
+ Enabled: true
338
+ VersionAdded: '2.10'
339
+ VersionChanged: '2.11'
340
+ Include:
341
+ - app/**/*.rb
342
+ - lib/**/*.rb
343
+ Exclude:
344
+ - lib/**/*.rake
345
+ AllowReads: false
346
+ AllowWrites: false
347
+
348
+ Rails/Exit:
349
+ Description: >-
350
+ Favor `fail`, `break`, `return`, etc. over `exit` in
351
+ application or library code outside of Rake files to avoid
352
+ exits during unit testing or running in production.
353
+ Enabled: true
354
+ VersionAdded: '0.41'
355
+ Include:
356
+ - app/**/*.rb
357
+ - config/**/*.rb
358
+ - lib/**/*.rb
359
+ Exclude:
360
+ - lib/**/*.rake
361
+
362
+ Rails/ExpandedDateRange:
363
+ Description: 'Checks for expanded date range.'
364
+ StyleGuide: 'https://rails.rubystyle.guide/#date-time-range'
365
+ Enabled: true
366
+ VersionAdded: '2.11'
367
+
368
+ Rails/FilePath:
369
+ Description: 'Use `Rails.root.join` for file path joining.'
370
+ Enabled: true
371
+ VersionAdded: '0.47'
372
+ VersionChanged: '2.4'
373
+ EnforcedStyle: arguments
374
+ SupportedStyles:
375
+ - slashes
376
+ - arguments
377
+
378
+ Rails/FindBy:
379
+ Description: 'Prefer find_by over where.first.'
380
+ StyleGuide: 'https://rails.rubystyle.guide#find_by'
381
+ Enabled: true
382
+ VersionAdded: '0.30'
383
+ VersionChanged: '2.11'
384
+ IgnoreWhereFirst: false
385
+ Include:
386
+ - app/models/**/*.rb
387
+ - app/controllers/**/*.rb
388
+ - app/helpers/**/*.rb
389
+
390
+ Rails/FindById:
391
+ Description: >-
392
+ Favor the use of `find` over `where.take!`, `find_by!`, and `find_by_id!` when you
393
+ need to retrieve a single record by primary key when you expect it to be found.
394
+ StyleGuide: 'https://rails.rubystyle.guide/#find'
395
+ Enabled: true
396
+ VersionAdded: '2.7'
397
+
398
+ Rails/FindEach:
399
+ Description: 'Prefer all.find_each over all.find.'
400
+ StyleGuide: 'https://rails.rubystyle.guide#find-each'
401
+ Enabled: true
402
+ VersionAdded: '0.30'
403
+ VersionChanged: '2.9'
404
+ Include: [ ]
405
+ AllowedMethods:
406
+ # Methods that don't work well with `find_each`.
407
+ - order
408
+ - limit
409
+ - select
410
+ - lock
411
+ AllowedPatterns: [ ]
412
+
413
+ Rails/FreezeTime:
414
+ Description: 'Prefer `freeze_time` over `travel_to` with an argument of the current time.'
415
+ StyleGuide: 'https://rails.rubystyle.guide/#freeze-time'
416
+ Enabled: false
417
+ VersionAdded: '2.16'
418
+ SafeAutoCorrect: false
419
+
420
+ Rails/HasAndBelongsToMany:
421
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
422
+ StyleGuide: 'https://rails.rubystyle.guide#has-many-through'
423
+ Enabled: true
424
+ VersionAdded: '0.12'
425
+ Include:
426
+ - app/models/**/*.rb
427
+
428
+ Rails/HasManyOrHasOneDependent:
429
+ Description: 'Define the dependent option to the has_many and has_one associations.'
430
+ StyleGuide: 'https://rails.rubystyle.guide#has_many-has_one-dependent-option'
431
+ Enabled: true
432
+ VersionAdded: '0.50'
433
+ Include:
434
+ - app/models/**/*.rb
435
+
436
+ Rails/HelperInstanceVariable:
437
+ Description: 'Do not use instance variables in helpers.'
438
+ Enabled: true
439
+ VersionAdded: '2.0'
440
+ Include:
441
+ - app/helpers/**/*.rb
442
+ Exclude:
443
+ - app/helpers/sessions_helper.rb
444
+
445
+ Rails/HttpPositionalArguments:
446
+ Description: 'Use keyword arguments instead of positional arguments in http method calls.'
447
+ Enabled: true
448
+ VersionAdded: '0.44'
449
+ Include:
450
+ - 'spec/**/*'
451
+ - 'test/**/*'
452
+
453
+ Rails/HttpStatus:
454
+ Description: 'Enforces use of symbolic or numeric value to define HTTP status.'
455
+ Enabled: true
456
+ VersionAdded: '0.54'
457
+ VersionChanged: '2.11'
458
+ EnforcedStyle: symbolic
459
+ SupportedStyles:
460
+ - numeric
461
+ - symbolic
462
+
463
+ Rails/I18nLazyLookup:
464
+ Description: 'Checks for places where I18n "lazy" lookup can be used.'
465
+ StyleGuide: 'https://rails.rubystyle.guide/#lazy-lookup'
466
+ Reference: 'https://guides.rubyonrails.org/i18n.html#lazy-lookup'
467
+ Enabled: false
468
+ VersionAdded: '2.14'
469
+ Include:
470
+ - 'app/controllers/**/*.rb'
471
+
472
+ Rails/I18nLocaleAssignment:
473
+ Description: 'Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.'
474
+ Enabled: true
475
+ VersionAdded: '2.11'
476
+ Include:
477
+ - spec/**/*.rb
478
+ - test/**/*.rb
479
+
480
+ Rails/I18nLocaleTexts:
481
+ Description: 'Enforces use of I18n and locale files instead of locale specific strings.'
482
+ StyleGuide: 'https://rails.rubystyle.guide/#locale-texts'
483
+ Enabled: false
484
+ VersionAdded: '2.14'
485
+
486
+ Rails/IgnoredColumnsAssignment:
487
+ Description: 'Looks for assignments of `ignored_columns` that override previous assignments.'
488
+ StyleGuide: 'https://rails.rubystyle.guide/#append-ignored-columns'
489
+ Enabled: true
490
+ SafeAutoCorrect: false
491
+ VersionAdded: '2.17'
492
+
493
+ Rails/IgnoredSkipActionFilterOption:
494
+ Description: 'Checks that `if` and `only` (or `except`) are not used together as options of `skip_*` action filter.'
495
+ Reference: 'https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options'
496
+ Enabled: true
497
+ VersionAdded: '0.63'
498
+ Include:
499
+ - app/controllers/**/*.rb
500
+ - app/mailers/**/*.rb
501
+
502
+ Rails/IndexBy:
503
+ Description: 'Prefer `index_by` over `each_with_object`, `to_h`, or `map`.'
504
+ Enabled: true
505
+ VersionAdded: '2.5'
506
+ VersionChanged: '2.8'
507
+
508
+ Rails/IndexWith:
509
+ Description: 'Prefer `index_with` over `each_with_object`, `to_h`, or `map`.'
510
+ Enabled: true
511
+ VersionAdded: '2.5'
512
+ VersionChanged: '2.8'
513
+
514
+ Rails/Inquiry:
515
+ Description: "Prefer Ruby's comparison operators over Active Support's `Array#inquiry` and `String#inquiry`."
516
+ StyleGuide: 'https://rails.rubystyle.guide/#inquiry'
517
+ Enabled: true
518
+ VersionAdded: '2.7'
519
+
520
+ Rails/InverseOf:
521
+ Description: 'Checks for associations where the inverse cannot be determined automatically.'
522
+ Enabled: true
523
+ VersionAdded: '0.52'
524
+ IgnoreScopes: false
525
+ Include:
526
+ - app/models/**/*.rb
527
+
528
+ Rails/LexicallyScopedActionFilter:
529
+ Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the class."
530
+ StyleGuide: 'https://rails.rubystyle.guide#lexically-scoped-action-filter'
531
+ Enabled: true
532
+ Safe: false
533
+ VersionAdded: '0.52'
534
+ Include:
535
+ - app/controllers/**/*.rb
536
+ - app/mailers/**/*.rb
537
+
538
+ Rails/LinkToBlank:
539
+ Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` option passed to them.'
540
+ Reference:
541
+ - https://mathiasbynens.github.io/rel-noopener/
542
+ - https://html.spec.whatwg.org/multipage/links.html#link-type-noopener
543
+ - https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer
544
+ Enabled: false
545
+ VersionAdded: '0.62'
546
+
547
+ Rails/MailerName:
548
+ Description: 'Mailer should end with `Mailer` suffix.'
549
+ StyleGuide: 'https://rails.rubystyle.guide/#mailer-name'
550
+ Enabled: true
551
+ SafeAutoCorrect: false
552
+ VersionAdded: '2.7'
553
+ Include:
554
+ - app/mailers/**/*.rb
555
+
556
+ Rails/MatchRoute:
557
+ Description: >-
558
+ Don't use `match` to define any routes unless there is a need to map multiple request types
559
+ among [:get, :post, :patch, :put, :delete] to a single action using the `:via` option.
560
+ StyleGuide: 'https://rails.rubystyle.guide/#no-match-routes'
561
+ Enabled: true
562
+ VersionAdded: '2.7'
563
+ Include:
564
+ - config/routes.rb
565
+ - config/routes/**/*.rb
566
+
567
+ Rails/MigrationClassName:
568
+ Description: 'The class name of the migration should match its file name.'
569
+ Enabled: true
570
+ VersionAdded: '2.14'
571
+ Include:
572
+ - db/migrate/*.rb
573
+
574
+ Rails/NegateInclude:
575
+ Description: 'Prefer `collection.exclude?(obj)` over `!collection.include?(obj)`.'
576
+ StyleGuide: 'https://rails.rubystyle.guide#exclude'
577
+ Enabled: true
578
+ Safe: false
579
+ VersionAdded: '2.7'
580
+ VersionChanged: '2.9'
581
+
582
+ Rails/NotNullColumn:
583
+ Description: 'Do not add a NOT NULL column without a default value.'
584
+ Enabled: false
585
+ VersionAdded: '0.43'
586
+ Include:
587
+ - db/migrate/*.rb
588
+
589
+ Rails/OrderById:
590
+ Description: >-
591
+ Do not use the `id` column for ordering.
592
+ Use a timestamp column to order chronologically.
593
+ StyleGuide: 'https://rails.rubystyle.guide/#order-by-id'
594
+ Enabled: false
595
+ VersionAdded: '2.8'
596
+
597
+ Rails/Output:
598
+ Description: 'Checks for calls to puts, print, etc.'
599
+ Enabled: true
600
+ SafeAutoCorrect: false
601
+ VersionAdded: '0.15'
602
+ VersionChanged: '0.19'
603
+ Include:
604
+ - app/**/*.rb
605
+ - config/**/*.rb
606
+ - lib/**/*.rb
607
+ Exclude:
608
+ - lib/generators/**/*.rb
609
+
610
+ Rails/OutputSafety:
611
+ Description: 'The use of `html_safe` or `raw` may be a security risk.'
612
+ Enabled: true
613
+ Severity: info # Or warning
614
+ VersionAdded: '0.41'
615
+
616
+ Rails/Pick:
617
+ Description: 'Prefer `pick` over `pluck(...).first`.'
618
+ StyleGuide: 'https://rails.rubystyle.guide#pick'
619
+ Enabled: true
620
+ Safe: false
621
+ VersionAdded: '2.6'
622
+
623
+ Rails/Pluck:
624
+ Description: 'Prefer `pluck` over `map { ... }`.'
625
+ StyleGuide: 'https://rails.rubystyle.guide#pluck'
626
+ Enabled: true
627
+ VersionAdded: '2.7'
628
+
629
+ Rails/PluckId:
630
+ Description: 'Use `ids` instead of `pluck(:id)` or `pluck(primary_key)`.'
631
+ StyleGuide: 'https://rails.rubystyle.guide/#ids'
632
+ Enabled: true
633
+ Safe: false
634
+ VersionAdded: '2.7'
635
+
636
+ Rails/PluckInWhere:
637
+ Description: 'Use `select` instead of `pluck` in `where` query methods.'
638
+ Enabled: true
639
+ Safe: false
640
+ VersionAdded: '2.7'
641
+ VersionChanged: '2.8'
642
+ EnforcedStyle: conservative
643
+ SupportedStyles:
644
+ - conservative
645
+ - aggressive
646
+
647
+ Rails/PluralizationGrammar:
648
+ Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
649
+ Enabled: true
650
+ VersionAdded: '0.35'
651
+
652
+ Rails/Presence:
653
+ Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
654
+ Enabled: true
655
+ VersionAdded: '0.52'
656
+
657
+ Rails/Present:
658
+ Description: 'Enforces use of `present?`.'
659
+ Enabled: true
660
+ VersionAdded: '0.48'
661
+ VersionChanged: '0.67'
662
+ # Convert usages of `!nil? && !empty?` to `present?`
663
+ NotNilAndNotEmpty: true
664
+ # Convert usages of `!blank?` to `present?`
665
+ NotBlank: true
666
+ # Convert usages of `unless blank?` to `if present?`
667
+ UnlessBlank: true
668
+
669
+ Rails/RakeEnvironment:
670
+ Description: 'Include `:environment` as a dependency for all Rake tasks.'
671
+ Enabled: true
672
+ Safe: false
673
+ VersionAdded: '2.4'
674
+ VersionChanged: '2.6'
675
+ Include:
676
+ - '**/Rakefile'
677
+ - '**/*.rake'
678
+ Exclude:
679
+ - 'lib/capistrano/tasks/**/*.rake'
680
+
681
+ Rails/ReadWriteAttribute:
682
+ Description: >-
683
+ Checks for read_attribute(:attr) and
684
+ write_attribute(:attr, val).
685
+ StyleGuide: 'https://rails.rubystyle.guide#read-attribute'
686
+ Enabled: true
687
+ VersionAdded: '0.20'
688
+ VersionChanged: '0.29'
689
+ Include:
690
+ - app/models/**/*.rb
691
+
692
+ Rails/RedundantAllowNil:
693
+ Description: >-
694
+ Finds redundant use of `allow_nil` when `allow_blank` is set to
695
+ certain values in model validations.
696
+ Enabled: true
697
+ VersionAdded: '0.67'
698
+ Include:
699
+ - app/models/**/*.rb
700
+
701
+ Rails/RedundantForeignKey:
702
+ Description: 'Checks for associations where the `:foreign_key` option is redundant.'
703
+ Enabled: true
704
+ VersionAdded: '2.6'
705
+
706
+ Rails/RedundantPresenceValidationOnBelongsTo:
707
+ Description: 'Checks for redundant presence validation on belongs_to association.'
708
+ Enabled: true
709
+ SafeAutoCorrect: false
710
+ VersionAdded: '2.13'
711
+
712
+ Rails/RedundantReceiverInWithOptions:
713
+ Description: 'Checks for redundant receiver in `with_options`.'
714
+ Enabled: true
715
+ VersionAdded: '0.52'
716
+
717
+ Rails/RedundantTravelBack:
718
+ Description: Checks for redundant `travel_back` calls.
719
+ Enabled: true
720
+ VersionAdded: '2.12'
721
+ Include:
722
+ - spec/**/*.rb
723
+ - test/**/*.rb
724
+
725
+ Rails/ReflectionClassName:
726
+ Description: 'Use a string for `class_name` option value in the definition of a reflection.'
727
+ Enabled: true
728
+ Safe: false
729
+ VersionAdded: '0.64'
730
+ VersionChanged: '2.10'
731
+
732
+ Rails/RefuteMethods:
733
+ Description: 'Use `assert_not` methods instead of `refute` methods.'
734
+ Enabled: true
735
+ VersionAdded: '0.56'
736
+ EnforcedStyle: assert_not
737
+ SupportedStyles:
738
+ - assert_not
739
+ - refute
740
+ Include:
741
+ - '**/test/**/*'
742
+
743
+ Rails/RelativeDateConstant:
744
+ Description: 'Do not assign relative date to constants.'
745
+ Enabled: true
746
+ SafeAutoCorrect: false
747
+ VersionAdded: '0.48'
748
+ VersionChanged: '2.13'
749
+
750
+ Rails/RenderInline:
751
+ Description: 'Prefer using a template over inline rendering.'
752
+ StyleGuide: 'https://rails.rubystyle.guide/#inline-rendering'
753
+ Enabled: true
754
+ VersionAdded: '2.7'
755
+
756
+ Rails/RenderPlainText:
757
+ Description: 'Prefer `render plain:` over `render text:`.'
758
+ StyleGuide: 'https://rails.rubystyle.guide/#plain-text-rendering'
759
+ Enabled: true
760
+ VersionAdded: '2.7'
761
+ # Convert only when `content_type` is explicitly set to `text/plain`.
762
+ ContentTypeCompatibility: true
763
+
764
+ Rails/RequestReferer:
765
+ Description: 'Use consistent syntax for request.referer.'
766
+ Enabled: true
767
+ VersionAdded: '0.41'
768
+ EnforcedStyle: referer
769
+ SupportedStyles:
770
+ - referer
771
+ - referrer
772
+
773
+ Rails/RequireDependency:
774
+ Description: 'Do not use `require_dependency` when running in Zeitwerk mode. `require_dependency` is for autoloading in classic mode.'
775
+ Reference: 'https://guides.rubyonrails.org/autoloading_and_reloading_constants.html'
776
+ Enabled: false
777
+ VersionAdded: '2.10'
778
+
779
+ Rails/ReversibleMigration:
780
+ Description: 'Checks whether the change method of the migration file is reversible.'
781
+ StyleGuide: 'https://rails.rubystyle.guide#reversible-migration'
782
+ Reference: 'https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
783
+ Enabled: true
784
+ VersionAdded: '0.47'
785
+ VersionChanged: '2.13'
786
+ Include:
787
+ - db/**/*.rb
788
+
789
+ Rails/ReversibleMigrationMethodDefinition:
790
+ Description: 'Checks whether the migration implements either a `change` method or both an `up` and a `down` method.'
791
+ Enabled: true
792
+ VersionAdded: '2.10'
793
+ VersionChanged: '2.13'
794
+ Include:
795
+ - db/**/*.rb
796
+
797
+ Rails/RootJoinChain:
798
+ Description: 'Use a single `#join` instead of chaining on `Rails.root` or `Rails.public_path`.'
799
+ Enabled: true
800
+ VersionAdded: '2.13'
801
+
802
+ Rails/RootPathnameMethods:
803
+ Description: 'Use `Rails.root` IO methods instead of passing it to `File`.'
804
+ Enabled: true
805
+ SafeAutoCorrect: false
806
+ VersionAdded: '2.16'
807
+
808
+ Rails/RootPublicPath:
809
+ Description: "Favor `Rails.public_path` over `Rails.root` with `'public'`."
810
+ Enabled: true
811
+ VersionAdded: '2.15'
812
+
813
+ Rails/SafeNavigation:
814
+ Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`."
815
+ Enabled: true
816
+ VersionAdded: '0.43'
817
+ # This will convert usages of `try` to use safe navigation as well as `try!`.
818
+ # `try` and `try!` work slightly differently. `try!` and safe navigation will
819
+ # both raise a `NoMethodError` if the receiver of the method call does not
820
+ # implement the intended method. `try` will not raise an exception for this.
821
+ ConvertTry: true
822
+
823
+ Rails/SafeNavigationWithBlank:
824
+ Description: 'Avoid `foo&.blank?` in conditionals.'
825
+ Enabled: true
826
+ VersionAdded: '2.4'
827
+ # While the safe navigation operator is generally a good idea, when
828
+ # checking `foo&.blank?` in a conditional, `foo` being `nil` will actually
829
+ # do the opposite of what the author intends.
830
+ #
831
+ # foo&.blank? #=> nil
832
+ # foo.blank? #=> true
833
+ SafeAutoCorrect: false
834
+
835
+ Rails/SaveBang:
836
+ Description: 'Identifies possible cases where Active Record save! or related should be used.'
837
+ StyleGuide: 'https://rails.rubystyle.guide#save-bang'
838
+ Enabled: true
839
+ VersionAdded: '0.42'
840
+ VersionChanged: '0.59'
841
+ AllowImplicitReturn: true
842
+ AllowedReceivers: [ ]# Project specific
843
+ SafeAutoCorrect: false
844
+
845
+ Rails/SchemaComment:
846
+ Description: >-
847
+ Enforces the use of the `comment` option when adding a new table or column
848
+ to the database during a migration.
849
+ Enabled: false
850
+ VersionAdded: '2.13'
851
+
852
+ Rails/ScopeArgs:
853
+ Description: 'Checks the arguments of ActiveRecord scopes.'
854
+ Enabled: true
855
+ VersionAdded: '0.19'
856
+ VersionChanged: '2.12'
857
+ Include:
858
+ - app/models/**/*.rb
859
+
860
+ Rails/ShortI18n:
861
+ Description: 'Use the short form of the I18n methods: `t` instead of `translate` and `l` instead of `localize`.'
862
+ StyleGuide: 'https://rails.rubystyle.guide/#short-i18n'
863
+ Enabled: true
864
+ VersionAdded: '2.7'
865
+ EnforcedStyle: conservative
866
+ SupportedStyles:
867
+ - conservative
868
+ - aggressive
869
+
870
+ Rails/SkipsModelValidations:
871
+ Description: >-
872
+ Use methods that skips model validations with caution.
873
+ See reference for more information.
874
+ Reference: 'https://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
875
+ Enabled: true
876
+ VersionAdded: '0.47'
877
+ VersionChanged: '2.7'
878
+ ForbiddenMethods:
879
+ - decrement!
880
+ - decrement_counter
881
+ - increment!
882
+ - increment_counter
883
+ - insert
884
+ - insert!
885
+ - insert_all
886
+ - insert_all!
887
+ - toggle!
888
+ - update_all
889
+ - update_attribute
890
+ - update_column
891
+ - update_columns
892
+ - update_counters
893
+ - upsert
894
+ - upsert_all
895
+ AllowedMethods:
896
+ - touch
897
+ - touch_all
898
+
899
+ Rails/SquishedSQLHeredocs:
900
+ Description: 'Checks SQL heredocs to use `.squish`.'
901
+ StyleGuide: 'https://rails.rubystyle.guide/#squished-heredocs'
902
+ Enabled: false
903
+ VersionAdded: '2.8'
904
+ VersionChanged: '2.9'
905
+ # Some SQL syntax (e.g. PostgreSQL comments and functions) requires newlines
906
+ # to be preserved in order to work, thus autocorrection is not safe.
907
+ SafeAutoCorrect: false
908
+
909
+ Rails/StripHeredoc:
910
+ Description: 'Enforces the use of squiggly heredoc over `strip_heredoc`.'
911
+ StyleGuide: 'https://rails.rubystyle.guide/#prefer-squiggly-heredoc'
912
+ Enabled: true
913
+ VersionAdded: '2.15'
914
+
915
+ Rails/TableNameAssignment:
916
+ Description: >-
917
+ Do not use `self.table_name =`. Use Inflections or `table_name_prefix` instead.
918
+ StyleGuide: 'https://rails.rubystyle.guide/#keep-ar-defaults'
919
+ Enabled: true
920
+ VersionAdded: '2.14'
921
+ Include:
922
+ - app/models/**/*.rb
923
+
924
+ Rails/TimeZone:
925
+ Description: 'Checks the correct usage of time zone aware methods.'
926
+ StyleGuide: 'https://rails.rubystyle.guide#time'
927
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
928
+ Enabled: true
929
+ SafeAutoCorrect: false
930
+ VersionAdded: '0.30'
931
+ VersionChanged: '2.13'
932
+ # The value `strict` means that `Time` should be used with `zone`.
933
+ # The value `flexible` allows usage of `in_time_zone` instead of `zone`.
934
+ EnforcedStyle: flexible
935
+ SupportedStyles:
936
+ - strict
937
+ - flexible
938
+ Exclude:
939
+ - '**/*.gemspec'
940
+
941
+ Rails/TimeZoneAssignment:
942
+ Description: 'Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` value.'
943
+ Reference: 'https://thoughtbot.com/blog/its-about-time-zones'
944
+ Enabled: true
945
+ VersionAdded: '2.10'
946
+ Include:
947
+ - spec/**/*.rb
948
+ - test/**/*.rb
949
+
950
+ Rails/ToFormattedS:
951
+ Description: 'Checks for consistent uses of `to_fs` or `to_formatted_s`.'
952
+ StyleGuide: 'https://rails.rubystyle.guide/#prefer-to-fs'
953
+ Enabled: true
954
+ EnforcedStyle: to_fs
955
+ SupportedStyles:
956
+ - to_fs
957
+ - to_formatted_s
958
+ VersionAdded: '2.15'
959
+
960
+ Rails/ToSWithArgument:
961
+ Description: 'Identifies passing any argument to `#to_s`.'
962
+ Enabled: true
963
+ Safe: false
964
+ VersionAdded: '2.16'
965
+
966
+ Rails/TopLevelHashWithIndifferentAccess:
967
+ Description: 'Identifies top-level `HashWithIndifferentAccess`.'
968
+ Reference: 'https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#top-level-hashwithindifferentaccess-is-soft-deprecated'
969
+ Enabled: true
970
+ VersionAdded: '2.16'
971
+
972
+ Rails/TransactionExitStatement:
973
+ Description: 'Avoid the usage of `return`, `break` and `throw` in transaction blocks.'
974
+ Enabled: true
975
+ VersionAdded: '2.14'
976
+
977
+ Rails/UniqBeforePluck:
978
+ Description: 'Prefer the use of uniq or distinct before pluck.'
979
+ Enabled: true
980
+ VersionAdded: '0.40'
981
+ VersionChanged: '2.13'
982
+ EnforcedStyle: aggressive
983
+ SupportedStyles:
984
+ - conservative
985
+ - aggressive
986
+ SafeAutoCorrect: false
987
+
988
+ Rails/UniqueValidationWithoutIndex:
989
+ Description: 'Uniqueness validation should have a unique index on the database column.'
990
+ Enabled: true
991
+ VersionAdded: '2.5'
992
+ Include:
993
+ - app/models/**/*.rb
994
+
995
+ Rails/UnknownEnv:
996
+ Description: 'Use correct environment name.'
997
+ Enabled: true
998
+ VersionAdded: '0.51'
999
+ Environments:
1000
+ - development
1001
+ - test
1002
+ - staging
1003
+ - production
1004
+
1005
+ Rails/UnusedIgnoredColumns:
1006
+ Description: 'Remove a column that does not exist from `ignored_columns`.'
1007
+ Enabled: true
1008
+ VersionAdded: '2.11'
1009
+ Include:
1010
+ - app/models/**/*.rb
1011
+
1012
+ Rails/Validation:
1013
+ Description: 'Use validates :attribute, hash of validations.'
1014
+ Enabled: true
1015
+ VersionAdded: '0.9'
1016
+ VersionChanged: '0.41'
1017
+ Include:
1018
+ - app/models/**/*.rb
1019
+
1020
+ Rails/WhereEquals:
1021
+ Description: 'Pass conditions to `where` as a hash instead of manually constructing SQL.'
1022
+ StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
1023
+ Enabled: true
1024
+ SafeAutoCorrect: false
1025
+ VersionAdded: '2.9'
1026
+ VersionChanged: '2.10'
1027
+
1028
+ Rails/WhereExists:
1029
+ Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
1030
+ Enabled: true
1031
+ SafeAutoCorrect: false
1032
+ EnforcedStyle: exists
1033
+ SupportedStyles:
1034
+ - exists
1035
+ - where
1036
+ VersionAdded: '2.7'
1037
+ VersionChanged: '2.10'
1038
+
1039
+ Rails/WhereMissing:
1040
+ Description: 'Use `where.missing(...)` to find missing relationship records.'
1041
+ StyleGuide: 'https://rails.rubystyle.guide/#finding-missing-relationship-records'
1042
+ Enabled: true
1043
+ VersionAdded: '2.16'
1044
+
1045
+ Rails/WhereNot:
1046
+ Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.'
1047
+ StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
1048
+ Enabled: true
1049
+ VersionAdded: '2.8'
1050
+
1051
+ Rails/WhereNotWithMultipleConditions:
1052
+ Description: 'Do not use `where.not(...)` with multiple conditions.'
1053
+ Enabled: true
1054
+ VersionAdded: '2.17'