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
Single line function fix #309
Comments
Also worth noting that if the second function has a non-empty body, i.e.
then it's fine too. |
@searls I'm sorry I haven't been able to share. This issue has not been resolved yet. I will let you know when it is resolved. |
@koic So this was not addressed in rubocop yet? Should I make an issue over there? |
@kardasis I opened rubocop/rubocop#9926 to resolve this issue. Thank you. |
Fixes standardrb/standard#309. This PR fixes an incorrect auto-correct for `Style/SingleLineMethods` when method body is enclosed in parentheses.
@searls This issue has been resolved with the release of RuboCop 1.18.4. |
Thanks @koic, @camilopayan released this update last night! |
Fixes standardrb/standard#309. This PR fixes an incorrect auto-correct for `Style/SingleLineMethods` when method body is enclosed in parentheses.
I have a file called
singlelinefunction.rb
with the following contentsWhen I run
bundle exec standardrb singlelinefunction.rb --fix
, the resulting file isWhich is obviously incorrect.
When I remove the second function definition, so the contents of the file is
Then the output is
Which seems like bad style but at least is correct ruby code.
The text was updated successfully, but these errors were encountered: