-
-
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
Layout/EmptyComment auto-correct incorrectly removes entire line #5674
Comments
It looks like this cop isn't accounting for empty comments next to code at all. The auto-correction is assuming that the line is going to be blank which is what is causing the issue. |
rrosenblum
added a commit
to rrosenblum/rubocop
that referenced
this issue
Mar 13, 2018
…nt is next to code
bbatsov
pushed a commit
that referenced
this issue
Mar 16, 2018
This was referenced Mar 21, 2018
This was referenced Mar 21, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
Given the contrived example file
example.rb
:When running
rubocop example.rb --only Layout/EmptyComment --auto-correct
I expect two warnings for the two empty comments, and for them to be removed from the end of the two lines.
Actual behavior
The lines with the empty comments are completely removed from the source:
And the output of the Rubocop execution:
RuboCop version
The text was updated successfully, but these errors were encountered: