From 31230f9d5fe03fb1b802f2a1520d0b57e00666a8 Mon Sep 17 00:00:00 2001 From: Zulfiqar Ali Date: Thu, 13 Mar 2025 13:55:54 -0400 Subject: [PATCH] update to rubocop-rails 2.30.x --- Gemfile.lock | 41 ++++++++++--------- config/base.yml | 9 ++++ ..._rubocop_rails_without_the_monkey_patch.rb | 10 ++--- standard-rails.gemspec | 2 +- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9590368..0117935 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ PATH specs: standard-rails (1.2.0) lint_roller (~> 1.0) - rubocop-rails (~> 2.26.0) + rubocop-rails (~> 2.30.0) GEM remote: https://rubygems.org/ @@ -49,27 +49,30 @@ GEM rack (3.1.7) rainbow (3.1.1) rake (13.2.1) - regexp_parser (2.9.2) - rubocop (1.66.1) + regexp_parser (2.10.0) + rubocop (1.73.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.34.1) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.38.1) parser (>= 3.3.1.0) - rubocop-performance (1.22.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.26.0) + rubocop-performance (1.24.0) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails (2.30.3) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.52.0, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (1.13.0) securerandom (0.3.1) simplecov (0.22.0) @@ -78,18 +81,18 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - standard (1.41.1) + standard (1.47.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) - rubocop (~> 1.66.0) + rubocop (~> 1.73.0) standard-custom (~> 1.0.0) - standard-performance (~> 1.5) + standard-performance (~> 1.7) standard-custom (1.0.2) lint_roller (~> 1.0) rubocop (~> 1.50) - standard-performance (1.5.0) + standard-performance (1.7.0) lint_roller (~> 1.1) - rubocop-performance (~> 1.22.0) + rubocop-performance (~> 1.24.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) diff --git a/config/base.yml b/config/base.yml index ac4bf60..dead3a8 100644 --- a/config/base.yml +++ b/config/base.yml @@ -30,6 +30,9 @@ Lint/SafeNavigationChain: - try! - in? +Lint/UselessAccessModifier: + Enabled: true + Rails/ActionControllerFlashBeforeRender: Enabled: false @@ -237,6 +240,9 @@ Rails/MatchRoute: Rails/MigrationClassName: Enabled: true +Rails/MultipleRoutePaths: + Enabled: true + Rails/NegateInclude: Enabled: false @@ -366,6 +372,9 @@ Rails/SquishedSQLHeredocs: Rails/StripHeredoc: Enabled: true +Rails/StrongParametersExpect: + Enabled: true + Rails/TableNameAssignment: Enabled: false diff --git a/lib/standard/rails/load_rubocop_rails_without_the_monkey_patch.rb b/lib/standard/rails/load_rubocop_rails_without_the_monkey_patch.rb index e137a1a..382fda5 100644 --- a/lib/standard/rails/load_rubocop_rails_without_the_monkey_patch.rb +++ b/lib/standard/rails/load_rubocop_rails_without_the_monkey_patch.rb @@ -7,7 +7,7 @@ # of RuboCop built-in cops in this file, we need to monitor it for changes # in rubocop-rails and keep it up to date. # -# Last updated from rubocop-rails v2.26.0 +# Last updated from rubocop-rails v2.30.3 # frozen_string_literal: true @@ -19,14 +19,14 @@ require_path = Pathname.new(Gem.loaded_specs["rubocop-rails"].full_require_paths.first) require require_path.join("rubocop/rails") require require_path.join("rubocop/rails/version") -# require_relative 'rubocop/rails/inject' require require_path.join("rubocop/rails/schema_loader") require require_path.join("rubocop/rails/schema_loader/schema") - -# RuboCop::Rails::Inject.defaults! - +require require_path.join("rubocop/rails/plugin") require require_path.join("rubocop/cop/rails_cops") +require require_path.join("rubocop/rails/migration_file_skippable") +RuboCop::Rails::MigrationFileSkippable.apply_to_cops! + RuboCop::Cop::Style::HashExcept.minimum_target_ruby_version(2.0) RuboCop::Cop::Style::InverseMethods.singleton_class.prepend( diff --git a/standard-rails.gemspec b/standard-rails.gemspec index 171ce07..7b69e8c 100644 --- a/standard-rails.gemspec +++ b/standard-rails.gemspec @@ -30,5 +30,5 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "lint_roller", "~> 1.0" - spec.add_dependency "rubocop-rails", "~> 2.26.0" + spec.add_dependency "rubocop-rails", "~> 2.30.0" end