Bump rubocop from 0.75.0 to 0.83.0

Recent versions introduce the `Layout/SpaceAroundMethodCallOperator`,
which we are going to use. We aren't upgrading to the latest rubocop
version because it conflicts with the version of Capybara we're using
and because it isn't supported by Hound.

Some rules have been renamed:

Layout/IndentAssignment is now Layout/AssignmentIndentation
Layout/IndentHeredoc is now Layout/HeredocIndentation
Layout/LeadingBlankLines is now Layout/LeadingEmptyLines
Layout/Tab is now Layout/IndentationStyle
Layout/TrailingBlankLines is now Layout/TrailingEmptyLines
Lint/StringConversionInInterpolation is now Lint/RedundantStringCoercion
Metrics/LineLength is now Layout/LineLength

Note after upgrading we get a new "offense" in the `StartWith` rule, so
we're changing the code in order to fix it.
This commit is contained in:
Javi Martín
2020-06-09 13:57:38 +02:00
parent 129fbb52e5
commit 199d8ff609
5 changed files with 31 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
rubocop: rubocop:
config_file: .rubocop.yml config_file: .rubocop.yml
version: 0.75.0 version: 0.83.0
scss: scss:
config_file: .scss-lint.yml config_file: .scss-lint.yml
erblint: erblint:

View File

@@ -28,6 +28,9 @@ Capybara/FeatureMethods:
FactoryBot/AttributeDefinedStatically: FactoryBot/AttributeDefinedStatically:
Enabled: true Enabled: true
Layout/AssignmentIndentation:
Enabled: true
Layout/EmptyLineAfterGuardClause: Layout/EmptyLineAfterGuardClause:
Enabled: true Enabled: true
@@ -58,21 +61,25 @@ Layout/EndOfLine:
Layout/ExtraSpacing: Layout/ExtraSpacing:
Enabled: true Enabled: true
Layout/IndentAssignment: Layout/HeredocIndentation:
Enabled: true
Layout/IndentHeredoc:
Enabled: true Enabled: true
Layout/IndentationConsistency: Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods EnforcedStyle: indented_internal_methods
Layout/IndentationStyle:
Enabled: true
Layout/IndentationWidth: Layout/IndentationWidth:
Enabled: true Enabled: true
Layout/LeadingBlankLines: Layout/LeadingEmptyLines:
Enabled: true Enabled: true
Layout/LineLength:
Max: 110
Severity: refactor
Layout/MultilineBlockLayout: Layout/MultilineBlockLayout:
Enabled: true Enabled: true
@@ -146,10 +153,7 @@ Layout/SpaceInsideReferenceBrackets:
Layout/SpaceInsideStringInterpolation: Layout/SpaceInsideStringInterpolation:
Enabled: true Enabled: true
Layout/Tab: Layout/TrailingEmptyLines:
Enabled: true
Layout/TrailingBlankLines:
Enabled: true Enabled: true
Layout/TrailingWhitespace: Layout/TrailingWhitespace:
@@ -167,22 +171,18 @@ Lint/LiteralAsCondition:
Lint/ParenthesesAsGroupedExpression: Lint/ParenthesesAsGroupedExpression:
Enabled: true Enabled: true
Lint/RedundantStringCoercion:
Enabled: true
Lint/SafeNavigationChain: Lint/SafeNavigationChain:
Enabled: true Enabled: true
Lint/ShadowingOuterLocalVariable: Lint/ShadowingOuterLocalVariable:
Enabled: true Enabled: true
Lint/StringConversionInInterpolation:
Enabled: true
Lint/UselessAssignment: Lint/UselessAssignment:
Enabled: true Enabled: true
Metrics/LineLength:
Max: 110
Severity: refactor
Performance/CompareWithBlock: Performance/CompareWithBlock:
Enabled: true Enabled: true

View File

@@ -98,8 +98,8 @@ group :development do
gem "erb_lint", require: false gem "erb_lint", require: false
gem "github_changelog_generator", "~> 1.15.0" gem "github_changelog_generator", "~> 1.15.0"
gem "mdl", "~> 0.5.0", require: false gem "mdl", "~> 0.5.0", require: false
gem "rubocop", "~> 0.75.0", require: false gem "rubocop", "~> 0.83.0", require: false
gem "rubocop-performance", "~> 1.4.1", require: false gem "rubocop-performance", "~> 1.6.1", require: false
gem "rubocop-rails", "~> 2.3.2", require: false gem "rubocop-rails", "~> 2.3.2", require: false
gem "rubocop-rspec", "~> 1.35.0", require: false gem "rubocop-rspec", "~> 1.35.0", require: false
gem "rvm1-capistrano3", "~> 1.4.0", require: false gem "rvm1-capistrano3", "~> 1.4.0", require: false

View File

@@ -286,7 +286,6 @@ GEM
railties (>= 3.1, < 6.0) railties (>= 3.1, < 6.0)
invisible_captcha (0.10.0) invisible_captcha (0.10.0)
rails (>= 3.2.0) rails (>= 3.2.0)
jaro_winkler (1.5.3)
jquery-fileupload-rails (0.4.7) jquery-fileupload-rails (0.4.7)
actionpack (>= 3.1) actionpack (>= 3.1)
railties (>= 3.1) railties (>= 3.1)
@@ -391,10 +390,10 @@ GEM
cocaine (~> 0.5.5) cocaine (~> 0.5.5)
mime-types mime-types
mimemagic (~> 0.3.0) mimemagic (~> 0.3.0)
parallel (1.17.0) parallel (1.19.1)
paranoia (2.4.2) paranoia (2.4.2)
activerecord (>= 4.0, < 6.1) activerecord (>= 4.0, < 6.1)
parser (2.6.5.0) parser (2.7.1.3)
ast (~> 2.4.0) ast (~> 2.4.0)
pg (0.21.0) pg (0.21.0)
pg_search (2.0.1) pg_search (2.0.1)
@@ -454,6 +453,7 @@ GEM
actionpack (>= 4.2.0, < 6.0) actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0)
retriable (3.1.2) retriable (3.1.2)
rexml (3.2.4)
rinku (2.0.4) rinku (2.0.4)
rollbar (2.18.0) rollbar (2.18.0)
multi_json multi_json
@@ -474,14 +474,14 @@ GEM
rspec-mocks (~> 3.8.0) rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0) rspec-support (~> 3.8.0)
rspec-support (3.8.0) rspec-support (3.8.0)
rubocop (0.75.0) rubocop (0.83.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.4.1) rubocop-performance (1.6.1)
rubocop (>= 0.71.0) rubocop (>= 0.71.0)
rubocop-rails (2.3.2) rubocop-rails (2.3.2)
rack (>= 1.1) rack (>= 1.1)
@@ -575,7 +575,7 @@ GEM
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.19) uglifier (4.1.19)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.0) unicode-display_width (1.7.0)
uniform_notifier (1.13.0) uniform_notifier (1.13.0)
user_agent_parser (2.6.0) user_agent_parser (2.6.0)
uuidtools (2.1.5) uuidtools (2.1.5)
@@ -676,8 +676,8 @@ DEPENDENCIES
rinku (~> 2.0.2) rinku (~> 2.0.2)
rollbar (~> 2.18.0) rollbar (~> 2.18.0)
rspec-rails (~> 3.8) rspec-rails (~> 3.8)
rubocop (~> 0.75.0) rubocop (~> 0.83.0)
rubocop-performance (~> 1.4.1) rubocop-performance (~> 1.6.1)
rubocop-rails (~> 2.3.2) rubocop-rails (~> 2.3.2)
rubocop-rspec (~> 1.35.0) rubocop-rspec (~> 1.35.0)
rvm1-capistrano3 (~> 1.4.0) rvm1-capistrano3 (~> 1.4.0)

View File

@@ -10,5 +10,5 @@ Ckeditor.setup do |config|
config.assets_languages = Rails.application.config.i18n.available_locales.map { |l| l.to_s.downcase } config.assets_languages = Rails.application.config.i18n.available_locales.map { |l| l.to_s.downcase }
config.assets_plugins = %w[image link magicline pastefromword table tableselection config.assets_plugins = %w[image link magicline pastefromword table tableselection
tabletools] tabletools]
config.assets.reject! { |asset| asset =~ /\Ackeditor\/samples\// } config.assets.reject! { |asset| asset.starts_with?("ckeditor/samples/") }
end end