Skip to content
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

SpaceAroundKeyword warns about chaining methods on yield #2775

Closed
maxjacobson opened this issue Feb 4, 2016 · 0 comments
Closed

SpaceAroundKeyword warns about chaining methods on yield #2775

maxjacobson opened this issue Feb 4, 2016 · 0 comments

Comments

@maxjacobson
Copy link
Contributor

def some_method
  puts yield.reverse
end

some_method { 'oliM' }

With RuboCop 0.37 this produces this warning:

Inspecting 1 file
C

Offenses:

test.rb:2:8: C: Style/SpaceAroundKeyword: Space after keyword yield is missing.
  puts yield.reverse
       ^^^^^

1 file inspected, 1 offense detected

yield is a keyword, but it returns a value and maybe you'll want to chain a method on it. I can move the method call to the next line but it doesn't feel like an ideal change

@bbatsov bbatsov closed this as completed in 6da703f Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant