-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 Bundler/OrderedGems
cop bug
#5623
Merged
bbatsov
merged 1 commit into
rubocop:master
from
colorbox:fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
Mar 8, 2018
Merged
Fix Bundler/OrderedGems
cop bug
#5623
bbatsov
merged 1 commit into
rubocop:master
from
colorbox:fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
Mar 8, 2018
+44
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorbox
force-pushed
the
fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
branch
from
March 4, 2018 00:03
ec405b6
to
db45946
Compare
rrosenblum
approved these changes
Mar 5, 2018
bbatsov
reviewed
Mar 6, 2018
CHANGELOG.md
Outdated
@@ -30,6 +30,7 @@ | |||
|
|||
### Bug fixes | |||
|
|||
* [#5623](https://github.com/bbatsov/rubocop/pull/5623): Fix `Bundler/OrderedGems` when a group includes duplicate gems. ([@colorbox][]) |
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.
The changelog entry should be moved, as a new release was cut a few days ago.
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.
Thank you. 🙏 Okay, I'l fix it.
colorbox
force-pushed
the
fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
branch
from
March 6, 2018 13:01
06ac104
to
107d8f3
Compare
## Summary This PR improves `Bundler/OrderedGems` autocorrect behavior on the specific situation. When group includes duplicate gems, and one of duplicate gems is in the first line of group, and one of them has offense `Bundler/OrderedGems`. The cop replace the gem out of group and the gem in group. ### Before For example, the target Gemfile is like below. ```ruby gem 'a' group :development do gem 'b' gem 'c' gem 'b' end ``` ### Expected Expected result of `rubocop -a --only Bundler/OrderedGems` is like below. ```ruby gem 'a' group :development do gem 'b' gem 'b' gem 'c' end ``` ### Actual But actual result is like below. ```ruby gem 'b' group :development do gem 'a' gem 'b' gem 'c' end ```
colorbox
force-pushed
the
fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
branch
from
March 6, 2018 13:57
107d8f3
to
c10b291
Compare
Thanks! |
colorbox
deleted the
fix_bundler_ordered_gem_cop_bug_when_group_includes_duplicate_gems
branch
March 8, 2018 04:50
This was referenced Mar 21, 2018
This was referenced Mar 21, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves
Bundler/OrderedGems
autocorrect behavior on thespecific situation.
When group includes duplicate gems, and one of duplicate gems is
in the first line of group, and one of them has
offense
Bundler/OrderedGems
.The cop replace the gem out of group and the gem in group.
Before
For example, the target Gemfile is like below.
Expected
Expected result of
rubocop -a --only Bundler/OrderedGems
is like below.
Actual
But actual result is like below.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
rake default
orrake parallel
. It executes all tests and RuboCop for itself, and generates the documentation.