From 9584781b1ec88ac986c1e2ea250e5ca55d7bf5bf Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 2 Jun 2023 18:19:31 +0900 Subject: [PATCH] Allow `params` receiver by default for `Style/CollectionMethods` Follow up https://github.com/rubocop/rubocop/pull/11909 and fixes https://github.com/rubocop/rubocop/issues/11908. --- .github/workflows/test.yml | 2 +- .../fix_make_style_collection_compact_aware_of_params.md | 1 + config/default.yml | 4 ++++ rubocop-rails.gemspec | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog/fix_make_style_collection_compact_aware_of_params.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6da67d197e..d029641b6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -93,7 +93,7 @@ jobs: -e "/gem 'rubocop-performance',/d" \ -e "/gem 'rubocop-rspec',/d" -i Gemfile cat << EOF > Gemfile.local - gem 'rubocop', '1.33.0' # Specify the oldest supported RuboCop version + gem 'rubocop', '1.52.0' # Specify the oldest supported RuboCop version EOF - name: set up Ruby uses: ruby/setup-ruby@v1 diff --git a/changelog/fix_make_style_collection_compact_aware_of_params.md b/changelog/fix_make_style_collection_compact_aware_of_params.md new file mode 100644 index 0000000000..f9e7223366 --- /dev/null +++ b/changelog/fix_make_style_collection_compact_aware_of_params.md @@ -0,0 +1 @@ +* [#1302](https://github.com/rubocop/rubocop-rails/pull/1302): Allow `params` receiver by default for `Style/CollectionMethods`. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index 9e0c976ba6..561b36484a 100644 --- a/config/default.yml +++ b/config/default.yml @@ -1234,6 +1234,10 @@ Rails/WhereRange: Style/AndOr: EnforcedStyle: conditionals +Style/CollectionCompact: + AllowedReceivers: + - params + Style/FormatStringToken: AllowedMethods: - redirect diff --git a/rubocop-rails.gemspec b/rubocop-rails.gemspec index 243bd5ff7c..5b2280749c 100644 --- a/rubocop-rails.gemspec +++ b/rubocop-rails.gemspec @@ -35,6 +35,6 @@ Gem::Specification.new do |s| # Rack::Utils::SYMBOL_TO_STATUS_CODE, which is used by HttpStatus cop, was # introduced in rack 1.1 s.add_dependency 'rack', '>= 1.1' - s.add_dependency 'rubocop', '>= 1.33.0', '< 2.0' + s.add_dependency 'rubocop', '>= 1.52.0', '< 2.0' s.add_dependency 'rubocop-ast', '>= 1.31.1', '< 2.0' end