Skip to content

Commit

Permalink
Bump RuboCop version to 0.77
Browse files Browse the repository at this point in the history
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
$
```
  • Loading branch information
yahonda committed Nov 27, 2019
1 parent be2473b commit 78c209a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -198,7 +198,7 @@ Lint/RequireParentheses:
Lint/ShadowingOuterLocalVariable:
Enabled: true

Lint/StringConversionInInterpolation:
Lint/RedundantStringCoercion:
Enabled: true

Lint/UriEscapeUnescape:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def initialize(connection, logger, connection_options, config)
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)
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/reflection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def automatic_inverse_of
end

if valid_inverse_reflection?(reflection)
return inverse_name
inverse_name
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/table_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def associated_table(table_name)
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)
Expand Down

0 comments on commit 78c209a

Please sign in to comment.