Bump RuboCop version to 0.77

https://github.com/rubocop-hq/rubocop/releases/tag/v0.77.0

* Update cop names to changed as follows:

```
$ bundle exec rubocop
Error: The `Layout/IndentFirstArgument` cop has been renamed to `Layout/FirstArgumentIndentation`.
(obsolete configuration found in .rubocop.yml, please update it)
The `Layout/TrailingBlankLines` cop has been renamed to `Layout/TrailingEmptyLines`.
(obsolete configuration found in .rubocop.yml, please update it)
The `Lint/StringConversionInInterpolation` cop has been renamed to `Lint/RedundantStringCoercion`.
(obsolete configuration found in .rubocop.yml, please update it)
$
```

* Auto correct these offenses:

```
$ bundle exec rubocop -a
... snip ...
Offenses:

activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:104:11: C: [Corrected] Style/RedundantReturn: Redundant return detected.
          return true
          ^^^^^^
activerecord/lib/active_record/reflection.rb:622:15: C: [Corrected] Style/RedundantReturn: Redundant return detected.
              return inverse_name
              ^^^^^^
activerecord/lib/active_record/table_metadata.rb:48:9: C: [Corrected] Style/RedundantReturn: Redundant return detected.
        return self
        ^^^^^^

2812 files inspected, 3 offenses detected, 3 offenses corrected
$
```
This commit is contained in:
Yasuo Honda 2019-11-27 23:53:47 +00:00
parent be2473b2ef
commit 78c209a693
5 changed files with 9 additions and 9 deletions

View File

@ -82,7 +82,7 @@ Layout/EmptyLinesAroundModuleBody:
Style/HashSyntax:
Enabled: true
Layout/IndentFirstArgument:
Layout/FirstArgumentIndentation:
Enabled: true
# Method definitions after `private` or `protected` isolated calls need one
@ -170,8 +170,8 @@ Style/StringLiterals:
Layout/Tab:
Enabled: true
# Blank lines should not have any spaces.
Layout/TrailingBlankLines:
# Empty lines should not have any spaces.
Layout/TrailingEmptyLines:
Enabled: true
# No trailing whitespace.
@ -198,7 +198,7 @@ Lint/RequireParentheses:
Lint/ShadowingOuterLocalVariable:
Enabled: true
Lint/StringConversionInInterpolation:
Lint/RedundantStringCoercion:
Enabled: true
Lint/UriEscapeUnescape:

View File

@ -348,7 +348,7 @@ GEM
nokogiri (1.10.4-x86-mingw32)
mini_portile2 (~> 2.4.0)
os (1.0.1)
parallel (1.19.0)
parallel (1.19.1)
parser (2.6.5.0)
ast (~> 2.4.0)
path_expander (1.1.0)
@ -408,7 +408,7 @@ GEM
resque (>= 1.26)
rufus-scheduler (~> 3.2)
retriable (3.1.2)
rubocop (0.76.0)
rubocop (0.77.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)

View File

@ -101,7 +101,7 @@ module ActiveRecord
def self.database_exists?(config)
config = config.symbolize_keys
if config[:database] == ":memory:"
return true
true
else
database_file = defined?(Rails.root) ? File.expand_path(config[:database], Rails.root) : config[:database]
File.exist?(database_file)

View File

@ -619,7 +619,7 @@ module ActiveRecord
end
if valid_inverse_reflection?(reflection)
return inverse_name
inverse_name
end
end
end

View File

@ -45,7 +45,7 @@ module ActiveRecord
association = klass._reflect_on_association(table_name) || klass._reflect_on_association(table_name.to_s.singularize)
if !association && table_name == arel_table.name
return self
self
elsif association && !association.polymorphic?
association_klass = association.klass
arel_table = association_klass.arel_table.alias(table_name)