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

[Fix #12113] Fix a false positive for Bundler/DuplicatedGroup #12116

Merged

Conversation

koic
Copy link
Member

@koic koic commented Aug 11, 2023

Fix #12113.

This PR fixes a false positive for Bundler/DuplicatedGroup when groups are duplicated but source, git, platforms, or path values are different.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@koic koic force-pushed the fix_a_false_positive_for_bundler_duplicated_group branch from f445cf7 to d950800 Compare August 11, 2023 15:11
@timon
Copy link
Contributor

timon commented Aug 11, 2023

I tried your branch against our Gemfile, the offense is gone now.
The only thing I'm not sure about is if people are going to face the same issue by using other block forms (git/path/platforms) — I hope these are not common to gemfiles

@koic koic force-pushed the fix_a_false_positive_for_bundler_duplicated_group branch 3 times, most recently from 3289ac2 to 2b67045 Compare August 11, 2023 17:03
@koic
Copy link
Member Author

koic commented Aug 11, 2023

@timon Great information! I've updated the PR to accommodate those blocks.

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 12, 2023

I think it'd be good to also add some examples covering this and keyword arguments to the docs, so it's clearer for users how the cop reasons about those.

@koic koic force-pushed the fix_a_false_positive_for_bundler_duplicated_group branch from 2b67045 to cd15eea Compare August 14, 2023 10:06
@koic
Copy link
Member Author

koic commented Aug 14, 2023

Sure, I've documented an acceptance case covered by this PR.

Fix rubocop#12113.

This PR fixes a false positive for `Bundler/DuplicatedGroup`
when groups are duplicated but `source`, `git`, `platforms`,
or `path` values are different.
@koic koic force-pushed the fix_a_false_positive_for_bundler_duplicated_group branch from cd15eea to 5da5286 Compare August 14, 2023 12:39
@bbatsov bbatsov merged commit dfddfa9 into rubocop:master Aug 16, 2023
28 checks passed
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 16, 2023

Thanks!

@koic koic deleted the fix_a_false_positive_for_bundler_duplicated_group branch August 16, 2023 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundler/DuplicatedGroup raises false positive when the same groups are defined with different sources
3 participants