config/default.yml in rubocop-rails-2.2.1 vs config/default.yml in rubocop-rails-2.3.0
- old
+ new
@@ -7,10 +7,13 @@
# If TargetRailsVersion is not set, RuboCop will parse the Gemfile.lock or
# gems.locked file to find the version of Rails that has been bound to the
# application. If neither of those files exist, RuboCop will use Rails 5.0
# as the default.
TargetRailsVersion: ~
+ # When specifying style guide URLs, any paths and/or fragments will be
+ # evaluated relative to the base URL.
+ StyleGuideBaseURL: https://rails.rubystyle.guide
Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.'
Enabled: true
VersionAdded: '0.19'
@@ -26,10 +29,11 @@
Avoid Active Record aliases:
Use `update` instead of `update_attributes`.
Use `update!` instead of `update_attributes!`.
Enabled: true
VersionAdded: '0.53'
+ SafeAutoCorrect: false
Rails/ActiveRecordOverride:
Description: >-
Check for overriding Active Record methods instead of using
callbacks.
@@ -134,16 +138,24 @@
Enabled: true
VersionAdded: '0.44'
Rails/DynamicFindBy:
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
+ StyleGuide: '#find_by'
Enabled: true
VersionAdded: '0.44'
Whitelist:
- find_by_sql
+Rails/EnumHash:
+ Description: 'Prefer hash syntax over array syntax when defining enums.'
+ StyleGuide: '#enums'
+ Enabled: true
+ VersionAdded: '2.3'
+ Include:
+ - app/models/**/*.rb
+
Rails/EnumUniqueness:
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
Enabled: true
VersionAdded: '0.46'
Include:
@@ -178,35 +190,35 @@
- slashes
- arguments
Rails/FindBy:
Description: 'Prefer find_by over where.first.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
+ StyleGuide: '#find_by'
Enabled: true
VersionAdded: '0.30'
Include:
- app/models/**/*.rb
Rails/FindEach:
Description: 'Prefer all.find_each over all.find.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find-each'
+ StyleGuide: '#find-each'
Enabled: true
VersionAdded: '0.30'
Include:
- app/models/**/*.rb
Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has-many-through'
+ StyleGuide: '#has-many-through'
Enabled: true
VersionAdded: '0.12'
Include:
- app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Description: 'Define the dependent option to the has_many and has_one associations.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has_many-has_one-dependent-option'
+ StyleGuide: '#has_many-has_one-dependent-option'
Enabled: true
VersionAdded: '0.50'
Include:
- app/models/**/*.rb
@@ -249,11 +261,11 @@
Include:
- app/models/**/*.rb
Rails/LexicallyScopedActionFilter:
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter'
+ StyleGuide: '#lexically-scoped-action-filter'
Enabled: true
Safe: false
VersionAdded: '0.52'
Include:
- app/controllers/**/*.rb
@@ -314,11 +326,11 @@
Rails/ReadWriteAttribute:
Description: >-
Checks for read_attribute(:attr) and
write_attribute(:attr, val).
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#read-attribute'
+ StyleGuide: '#read-attribute'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.29'
Include:
- app/models/**/*.rb
@@ -365,11 +377,11 @@
- referer
- referrer
Rails/ReversibleMigration:
Description: 'Checks whether the change method of the migration file is reversible.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#reversible-migration'
+ StyleGuide: '#reversible-migration'
Reference: 'https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
Enabled: true
VersionAdded: '0.47'
Include:
- db/migrate/*.rb
@@ -384,16 +396,17 @@
# implement the intended method. `try` will not raise an exception for this.
ConvertTry: false
Rails/SaveBang:
Description: 'Identifies possible cases where Active Record save! or related should be used.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#save-bang'
+ StyleGuide: '#save-bang'
Enabled: false
VersionAdded: '0.42'
VersionChanged: '0.59'
AllowImplicitReturn: true
AllowedReceivers: []
+ SafeAutoCorrect: false
Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Enabled: true
VersionAdded: '0.19'
@@ -422,10 +435,10 @@
- update_counters
Whitelist: []
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
- StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time'
+ StyleGuide: '#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
Safe: false
VersionAdded: '0.30'
VersionChanged: '0.68'