From 199d8ff609130f072d0285e84dbac846c2e644db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 9 Jun 2020 13:57:38 +0200 Subject: [PATCH] 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. --- .hound.yml | 2 +- .rubocop.yml | 32 ++++++++++++++++---------------- Gemfile | 4 ++-- Gemfile.lock | 22 +++++++++++----------- config/initializers/ckeditor.rb | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.hound.yml b/.hound.yml index 2c4f3544b..0b423860b 100644 --- a/.hound.yml +++ b/.hound.yml @@ -1,6 +1,6 @@ rubocop: config_file: .rubocop.yml - version: 0.75.0 + version: 0.83.0 scss: config_file: .scss-lint.yml erblint: diff --git a/.rubocop.yml b/.rubocop.yml index 3d300e690..5eb40177c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -28,6 +28,9 @@ Capybara/FeatureMethods: FactoryBot/AttributeDefinedStatically: Enabled: true +Layout/AssignmentIndentation: + Enabled: true + Layout/EmptyLineAfterGuardClause: Enabled: true @@ -58,21 +61,25 @@ Layout/EndOfLine: Layout/ExtraSpacing: Enabled: true -Layout/IndentAssignment: - Enabled: true - -Layout/IndentHeredoc: +Layout/HeredocIndentation: Enabled: true Layout/IndentationConsistency: EnforcedStyle: indented_internal_methods +Layout/IndentationStyle: + Enabled: true + Layout/IndentationWidth: Enabled: true -Layout/LeadingBlankLines: +Layout/LeadingEmptyLines: Enabled: true +Layout/LineLength: + Max: 110 + Severity: refactor + Layout/MultilineBlockLayout: Enabled: true @@ -146,10 +153,7 @@ Layout/SpaceInsideReferenceBrackets: Layout/SpaceInsideStringInterpolation: Enabled: true -Layout/Tab: - Enabled: true - -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Enabled: true Layout/TrailingWhitespace: @@ -167,22 +171,18 @@ Lint/LiteralAsCondition: Lint/ParenthesesAsGroupedExpression: Enabled: true +Lint/RedundantStringCoercion: + Enabled: true + Lint/SafeNavigationChain: Enabled: true Lint/ShadowingOuterLocalVariable: Enabled: true -Lint/StringConversionInInterpolation: - Enabled: true - Lint/UselessAssignment: Enabled: true -Metrics/LineLength: - Max: 110 - Severity: refactor - Performance/CompareWithBlock: Enabled: true diff --git a/Gemfile b/Gemfile index 357bef31e..6b90aebc9 100644 --- a/Gemfile +++ b/Gemfile @@ -98,8 +98,8 @@ group :development do gem "erb_lint", require: false gem "github_changelog_generator", "~> 1.15.0" gem "mdl", "~> 0.5.0", require: false - gem "rubocop", "~> 0.75.0", require: false - gem "rubocop-performance", "~> 1.4.1", require: false + gem "rubocop", "~> 0.83.0", require: false + gem "rubocop-performance", "~> 1.6.1", require: false gem "rubocop-rails", "~> 2.3.2", require: false gem "rubocop-rspec", "~> 1.35.0", require: false gem "rvm1-capistrano3", "~> 1.4.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9e82d3ff6..0586bbb0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -286,7 +286,6 @@ GEM railties (>= 3.1, < 6.0) invisible_captcha (0.10.0) rails (>= 3.2.0) - jaro_winkler (1.5.3) jquery-fileupload-rails (0.4.7) actionpack (>= 3.1) railties (>= 3.1) @@ -391,10 +390,10 @@ GEM cocaine (~> 0.5.5) mime-types mimemagic (~> 0.3.0) - parallel (1.17.0) + parallel (1.19.1) paranoia (2.4.2) activerecord (>= 4.0, < 6.1) - parser (2.6.5.0) + parser (2.7.1.3) ast (~> 2.4.0) pg (0.21.0) pg_search (2.0.1) @@ -454,6 +453,7 @@ GEM actionpack (>= 4.2.0, < 6.0) railties (>= 4.2.0, < 6.0) retriable (3.1.2) + rexml (3.2.4) rinku (2.0.4) rollbar (2.18.0) multi_json @@ -474,14 +474,14 @@ GEM rspec-mocks (~> 3.8.0) rspec-support (~> 3.8.0) rspec-support (3.8.0) - rubocop (0.75.0) - jaro_winkler (~> 1.5.1) + rubocop (0.83.0) parallel (~> 1.10) - parser (>= 2.6) + parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + rexml ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) - rubocop-performance (1.4.1) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-performance (1.6.1) rubocop (>= 0.71.0) rubocop-rails (2.3.2) rack (>= 1.1) @@ -575,7 +575,7 @@ GEM thread_safe (~> 0.1) uglifier (4.1.19) execjs (>= 0.3.0, < 3) - unicode-display_width (1.6.0) + unicode-display_width (1.7.0) uniform_notifier (1.13.0) user_agent_parser (2.6.0) uuidtools (2.1.5) @@ -676,8 +676,8 @@ DEPENDENCIES rinku (~> 2.0.2) rollbar (~> 2.18.0) rspec-rails (~> 3.8) - rubocop (~> 0.75.0) - rubocop-performance (~> 1.4.1) + rubocop (~> 0.83.0) + rubocop-performance (~> 1.6.1) rubocop-rails (~> 2.3.2) rubocop-rspec (~> 1.35.0) rvm1-capistrano3 (~> 1.4.0) diff --git a/config/initializers/ckeditor.rb b/config/initializers/ckeditor.rb index 127b5b626..90998af98 100644 --- a/config/initializers/ckeditor.rb +++ b/config/initializers/ckeditor.rb @@ -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_plugins = %w[image link magicline pastefromword table tableselection tabletools] - config.assets.reject! { |asset| asset =~ /\Ackeditor\/samples\// } + config.assets.reject! { |asset| asset.starts_with?("ckeditor/samples/") } end