You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rubocop 1.56 introduced new Bundler/DuplicatedGroup cop, which complains on our gemfile
We use both standard rubygems repository as well as private github gems storage, nesting private gems into source private_github_repo block. This is how our Gemfile looks like:
This Gemfile has group :development, :test block defined twice: on line 13, nested into source block, and on line 22, without nesting.
Expected behavior
No offense should be reported, since block defined on line 13 has extra options (source) which the block on line 22 does not have
Actual behavior
Rubocop registers offence for line 22, claiming that "the same" group was declared on line 13:
$ bundle exec rubocop --debug Gemfile 2>&1 | sed s,`pwd`,'[Rails.root]',g
For [Rails.root]: configuration from [Rails.root]/.rubocop.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-performance-1.18.0/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-performance-1.18.0/config/default.yml
Default configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-1.56.0/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-rails-2.20.2/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-rails-2.20.2/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-capybara-2.18.0/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-capybara-2.18.0/lib/../config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.23.1/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.23.1/lib/../config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.23.2/config/default.yml
configuration from [Rails.root]/vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.23.2/config/default.yml
Use parallel by default.
Skipping parallel inspection: only a single file needs inspection
Inspecting 1 file
Scanning [Rails.root]/Gemfile
Loading cache from /Users/artemignatyev/.cache/rubocop_cache/ea73f893fd75fed6eb3813edaaceafed125998c9/431d3268f19f244d7cfb330d6e2b8d2d9996286a/11f439d95cfe2aa0aebd37556039f22050a11e81
W
Offenses:
Gemfile:22:1: W: Bundler/DuplicatedGroup: Gem group development, test already defined on line 13 of the Gemfile.
group :development, :test do
^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected
Finished in 0.4624439999461174 seconds
Steps to reproduce the problem
Author a gemfile, that has the same group defined within different source blocks (or one nested within the source block and one defined at top level)
An error occurred while Bundler/DuplicatedGroup cop was inspecting /home/ixti/Projects/sidekiq-pauzer/Gemfile.
undefined method `value' for s(:hash,
s(:pair,
s(:sym, :optional),
s(:true))):RuboCop::AST::HashNode
/home/ixti/.gem/ruby/3.2.2/gems/rubocop-1.56.0/lib/rubocop/cop/bundler/duplicated_group.rb:63:in `map'
/home/ixti/.gem/ruby/3.2.2/gems/rubocop-1.56.0/lib/rubocop/cop/bundler/duplicated_group.rb:63:in `block in duplicated_group_nodes'
/home/ixti/.gem/ruby/3.2.2/gems/rubocop-1.56.0/lib/rubocop/cop/bundler/duplicated_group.rb:69:in `block in group_declarations'
Fixrubocop#12113.
This PR fixes a false positive for `Bundler/DuplicatedGroup`
when groups are duplicated but `source`, `git`, `platforms`,
or `path` values are different.
Fix#12113.
This PR fixes a false positive for `Bundler/DuplicatedGroup`
when groups are duplicated but `source`, `git`, `platforms`,
or `path` values are different.
Rubocop 1.56 introduced new
Bundler/DuplicatedGroup
cop, which complains on our gemfileWe use both standard rubygems repository as well as private github gems storage, nesting private gems into
source private_github_repo
block. This is how our Gemfile looks like:This Gemfile has
group :development, :test
block defined twice: on line 13, nested intosource
block, and on line 22, without nesting.Expected behavior
No offense should be reported, since block defined on line 13 has extra options (
source
) which the block on line 22 does not haveActual behavior
Rubocop registers offence for line 22, claiming that "the same" group was declared on line 13:
Steps to reproduce the problem
source
blocks (or one nested within thesource
block and one defined at top level)RuboCop version
The text was updated successfully, but these errors were encountered: