-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Bundler/OrderedGems
autocorrect behavior
## 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 ```
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
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
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
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