Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundler/DuplicatedGroup undefined method #12111

Closed
Carlgo11 opened this issue Aug 9, 2023 · 0 comments · Fixed by #12112
Closed

Bundler/DuplicatedGroup undefined method #12111

Carlgo11 opened this issue Aug 9, 2023 · 0 comments · Fixed by #12112
Labels

Comments

@Carlgo11
Copy link

Carlgo11 commented Aug 9, 2023

Expected behavior

Preferably, to Rubocop not to return errors.

$ bundle exec rubocop
Inspecting 15 files
...............

15 files inspected, no offenses detected
$ echo $?
0

Actual behavior

$ bundle exec rubocop
An error occurred while Bundler/DuplicatedGroup cop was inspecting /home/user/Git/2factorauth/twofactorauth/Gemfile.
To see the complete backtrace run rubocop -d.
Inspecting 15 files
An error occurred while Bundler/DuplicatedGroup cop was inspecting /home/user/Git/2factorauth/twofactorauth/Gemfile.
To see the complete backtrace run rubocop -d.
$ echo $?
1
...............

15 files inspected, no offenses detected

1 error occurred:
An error occurred while Bundler/DuplicatedGroup cop was inspecting /home/user/Git/2factorauth/twofactorauth/Gemfile.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
https://github.com/rubocop/rubocop/issues

Mention the following information in the issue report:
1.56.0 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.1.2) [x86_64-linux-gnu]
Scanning /home/user/Git/2factorauth/twofactorauth/Gemfile
An error occurred while Bundler/DuplicatedGroup cop was inspecting /home/user/Git/2factorauth/twofactorauth/Gemfile.
undefined method `value' for s(:hash,
  s(:pair,
    s(:sym, :optional),
    s(:true))):RuboCop::AST::HashNode

            .group_by { |node| node.arguments.map(&:value).map(&:to_s).sort }
                                             ^^^^
Did you mean?  values

Steps to reproduce the problem

Run Rubocop (using a version where #12074 is included) with the following Gemfile:

# frozen_string_literal: true

source 'https://rubygems.org'

group :tests, optional: true do
  gem 'activesupport'
  gem 'addressable'
  gem 'json_schemer'
  gem 'nokogiri'
  gem 'rubocop'
  gem 'twitter'
end

gem 'algolia', '~> 2.3'
gem 'dotenv', '~> 2.8'
gem 'parallel', '~> 1.22'

RuboCop version

$ bundle exec rubocop -V
1.56.0 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.1.2) [x86_64-linux-gnu]
@koic koic added the bug label Aug 10, 2023
koic added a commit to koic/rubocop that referenced this issue Aug 10, 2023
Fixes rubocop#12111.

This PR fixes an error for `Bundler/DuplicatedGroup`
group declaration has keyword option.
bbatsov pushed a commit that referenced this issue Aug 11, 2023
Fixes #12111.

This PR fixes an error for `Bundler/DuplicatedGroup`
group declaration has keyword option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants