-
-
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
Auto-correct compressed hash syntax incorrect #5019
Labels
Comments
It is a problem of Minimum reproduce
a:b => c $ rubocop --only Style/HashSyntax -a
$ rubocop --only Style/HashSyntax -a
Inspecting 1 file
E
Offenses:
test.rb:1:2: C: [Corrected] Use the new Ruby 1.9 hash syntax.
a:b => c
^^^^^
test.rb:1:3: E: unexpected token tCOLON
(Using Ruby 2.1 parser; configure using TargetRubyVersion parameter, under AllCops)
ab: c
^
1 file inspected, 2 offenses detected, 1 offense corrected
$ cat test.rb
ab: c |
I cannot reproduce.
|
@donjar Can you try
This correction conceals the bug. |
Oops, didn't notice that. Yeah now it errors.
I'll try a fix. :) |
donjar
added a commit
to donjar/rubocop
that referenced
this issue
Nov 11, 2017
donjar
added a commit
to donjar/rubocop
that referenced
this issue
Nov 11, 2017
Drenmi
added a commit
to Drenmi/rubocop
that referenced
this issue
Nov 11, 2017
…ash is used as unspaced argument This cop's' auto-correct would result in invalid syntax when hash rocket hashes are used as unspaced arguments. This change fixes that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An issue with compressed hash syntax being incorrectly auto-corrected.
Expected behavior
model.save(validate:true)
Actual behavior
model.savevalidate: true
Steps to reproduce the problem
then run
rubocop --auto-correct
RuboCop version
The text was updated successfully, but these errors were encountered: