config/default.yml in rubocop-rails-2.12.4 vs config/default.yml in rubocop-rails-2.13.0
- old
+ new
@@ -178,10 +178,16 @@
- mysql
- postgresql
Include:
- db/migrate/*.rb
+Rails/CompactBlank:
+ Description: 'Checks if collection can be blank-compacted with `compact_blank`.'
+ Enabled: pending
+ Safe: false
+ VersionAdded: '2.13'
+
Rails/ContentTag:
Description: 'Use `tag.something` instead of `tag(:something)`.'
Reference:
- 'https://github.com/rubocop/rubocop-rails/issues/260'
- 'https://github.com/rails/rails/issues/25195'
@@ -243,10 +249,16 @@
Rails/DelegateAllowBlank:
Description: 'Do not use allow_blank as an option to delegate.'
Enabled: true
VersionAdded: '0.44'
+Rails/DurationArithmetic:
+ Description: 'Do not use duration as arithmetic operand with `Time.current`.'
+ StyleGuide: 'https://rails.rubystyle.guide#duration-arithmetic'
+ Enabled: pending
+ VersionAdded: '2.13'
+
Rails/DynamicFindBy:
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
StyleGuide: 'https://rails.rubystyle.guide#find_by'
Enabled: true
Safe: false
@@ -610,10 +622,15 @@
Rails/RedundantForeignKey:
Description: 'Checks for associations where the `:foreign_key` option is redundant.'
Enabled: true
VersionAdded: '2.6'
+Rails/RedundantPresenceValidationOnBelongsTo:
+ Description: 'Checks for redundant presence validation on belongs_to association.'
+ Enabled: pending
+ VersionAdded: '2.13'
+
Rails/RedundantReceiverInWithOptions:
Description: 'Checks for redundant receiver in `with_options`.'
Enabled: true
VersionAdded: '0.52'
@@ -644,13 +661,13 @@
- '**/test/**/*'
Rails/RelativeDateConstant:
Description: 'Do not assign relative date to constants.'
Enabled: true
+ SafeAutoCorrect: false
VersionAdded: '0.48'
- VersionChanged: '0.59'
- AutoCorrect: false
+ VersionChanged: '2.13'
Rails/RenderInline:
Description: 'Prefer using a template over inline rendering.'
StyleGuide: 'https://rails.rubystyle.guide/#inline-rendering'
Enabled: 'pending'
@@ -693,10 +710,15 @@
Enabled: false
VersionAdded: '2.10'
Include:
- db/migrate/*.rb
+Rails/RootJoinChain:
+ Description: 'Use a single `#join` instead of chaining on `Rails.root` or `Rails.public_path`.'
+ Enabled: pending
+ VersionAdded: '2.13'
+
Rails/SafeNavigation:
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`."
Enabled: true
VersionAdded: '0.43'
# This will convert usages of `try` to use safe navigation as well as `try!`.
@@ -725,10 +747,17 @@
VersionChanged: '0.59'
AllowImplicitReturn: true
AllowedReceivers: []
SafeAutoCorrect: false
+Rails/SchemaComment:
+ Description: >-
+ This cop enforces the use of the `comment` option when adding a new table or column
+ to the database during a migration.
+ Enabled: false
+ VersionAdded: '2.13'
+
Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '2.12'
@@ -787,13 +816,13 @@
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://rails.rubystyle.guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
- Safe: false
+ SafeAutoCorrect: false
VersionAdded: '0.30'
- VersionChanged: '2.10'
+ VersionChanged: '2.13'
# The value `strict` means that `Time` should be used with `zone`.
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
EnforcedStyle: flexible
SupportedStyles:
- strict
@@ -812,16 +841,15 @@
Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.'
Enabled: true
VersionAdded: '0.40'
- VersionChanged: '2.8'
+ VersionChanged: '2.13'
EnforcedStyle: conservative
SupportedStyles:
- conservative
- aggressive
SafeAutoCorrect: false
- AutoCorrect: false
Rails/UniqueValidationWithoutIndex:
Description: 'Uniqueness validation should have a unique index on the database column.'
Enabled: true
VersionAdded: '2.5'