-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add new Bundler/DuplicatedGroup
cop
#12074
Add new Bundler/DuplicatedGroup
cop
#12074
Conversation
module RuboCop | ||
module Cop | ||
module Bundler | ||
# A Gem group should be listed only once in a Gemfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the examples that's not exactly true, so you might want to expand this description.
# gem 'rubocop-rails' | ||
# end | ||
# | ||
# # bad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to explain why this is bad and the next example is good, as it's not obvious to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(to be clear - it took me a moment to see that the names were the same, but in different order)
@bbatsov |
@matthewhively An oversight on my part. :-) At any rate, it's more or less a Lint cop, so I'm guessing most people would have enabled it anyways. |
New cop validating each gem group (or a set of groups) is only defined once.
This has been suggested many years ago here #3600 but I couldn't find any attempts at implementing it.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.