-
-
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
Bundler/OrderedGems
cop should respect ASCII order when gem name has symbols
#3923
Labels
Comments
Guess so. |
11 tasks
mikegee
added a commit
to mikegee/rubocop
that referenced
this issue
Jan 18, 2017
The underscore character is between the uppercase and lowercase alphabetical characters in ASCII. Folks expect "_" to come before "a", but `String#casecmp` is implemented by uppercasing the inputs before comparing them. This leads to "_" coming after alphabetical characters.
bbatsov
pushed a commit
that referenced
this issue
Jan 18, 2017
The underscore character is between the uppercase and lowercase alphabetical characters in ASCII. Folks expect "_" to come before "a", but `String#casecmp` is implemented by uppercasing the inputs before comparing them. This leads to "_" coming after alphabetical characters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
Bundler/OrderedGems
cop (PR) should respect ASCII order.Actual behavior
I have the following gems in my Gemfile:
Vim sorts it this way, which is correct:
_
symbol comes before letters in ASCII table. However, this cop complains:Gemfile:27:1: C: Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem paperclip should appear before paper_trail
.Reference:
Steps to reproduce the problem
Add the gems in the same order mentioned in the previous step and run
$ rubocop
.RuboCop version
The text was updated successfully, but these errors were encountered: