-
-
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
Space around keyword produces misleading results for super #3116
Comments
Can you give a minimal reproducible example? I tried your code, but contains a syntax error:
So I removed the
I'm running Can you provide the output of running |
The code sample uses ruby 2.3 safe navigation syntax, so you need at least ruby version 2.3.0 for it to work. The rubocop version is:
|
Minimal example using ruby 2.3: foo.rb def my_method
super&.a_method_on_super
end .rubocop.yml AllCops:
DisabledByDefault: true
TargetRubyVersion: 2.3
Style/SpaceAroundKeyword:
Description: "Use a space around keywords if appropriate."
Enabled: true output: $ rubocop -V
0.40.0 (using Parser 2.3.1.0, running on ruby 2.3.1 x86_64-darwin15)
$ rubocop -D foo.rb
Inspecting 1 file
C
Offenses:
foo.rb:2:3: C: Style/SpaceAroundKeyword: Space after keyword super is missing.
super&.a_method_on_super
^^^^^
1 file inspected, 1 offense detected |
As seen from the example, updating to 0.40 didn't change much. |
I have a fix for this locally, about to make a PR |
Aha, of course, I forgot about the new safe navigation operator (I'm stuck on |
Fixed in #3118. This can be closed @rwz @segiddins Going further please add something like |
Cool, thanks for taking care of it! 👍 |
This code produces an offense of
Style/SpaceAroundKeyword
: Space after keyword super is missing.Seems like a false positive to me.
The text was updated successfully, but these errors were encountered: