-
-
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 handling of fullwidth characters in AlignArray #2710
Fix handling of fullwidth characters in AlignArray #2710
Conversation
5a1f7ff
to
41eca5b
Compare
Interesting. I've noticed that Emacs seems to indent/align the same way in the presence of these fullwidth characters. With some fonts the alignment is pretty good. With others it's a bit off, but I suppose that's just the way it is. The change also affects some of the other cops that include |
Interesting, I didn't know this was an issue. The commit looks good to me. Slightly annoying that we need to add another dependency, but I am glad we do not need to handle that logic ourselves. |
OK, I'll add more spec examples, thanks! |
41eca5b
to
b7dceda
Compare
Updated and rebased. I added tests against cops using |
b7dceda
to
f7c15a6
Compare
👍 Looks good to me. Note to self: see if |
You'll have to rebase on top of the current |
f7c15a6
to
363a87e
Compare
Rebased. |
@@ -31,6 +31,7 @@ | |||
* [#2664](https://github.com/bbatsov/rubocop/issues/2664): `Performance/Casecmp` can auto-correct case comparison to variables and method calls without error. ([@rrosenblum][]) | |||
* [#2729](https://github.com/bbatsov/rubocop/issues/2729): Fix handling of hash literal as the first argument in `Style/RedundantParentheses`. ([@lumeet][]) | |||
* [#2703](https://github.com/bbatsov/rubocop/issues/2703): Handle byte order mark in `Style/IndentationWidth`, `Style/ElseAlignment`, `Lint/EndAlignment`, and `Lint/DefEndAlignment`. ([@jonas054][]) | |||
* [#2710](https://github.com/bbatsov/rubocop/pull/2710): Fix handling of fullwidth characters in `Style/AlignArray`. ([@seikichi][]) |
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.
Btw, you actually fix more than this in the current version of the commit, so I'd suggest extending this changelog entry and changing the commit message itself.
I fixed the handling of fullwidth characters in following cops: - `Style/AlignArray` - `Style/AlignParameters` - `Style/FirstParameterIndentation` - `Style/IndentAssignment` - `Style/IndentationConsistency`
363a87e
to
e383249
Compare
Thanks for your feedback. I changed the commit message and the changelog entry, and rebased. |
Fix handling of fullwidth characters in some cops
👍 |
I fixed the handling of fullwidth characters in
Style/AlignArray
.The following code:
yield the offence:
I chose the gem unicode-display_width to calculate display width because ...