-
-
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
IndentationWidth auto-correct breaks block comments #1117
Comments
I haven't seen those in a while. :-) @jonas054 Would you, please, handle this? I'm also thinking we should add auto-correct support to our block comments cop to convert them to regular comments. |
Found a similar issue with heredoc Before: module Foo
module Bar
SOMETHING = <<GOO
text
more text
foo
GOO
def baz
do_something
end
end
end After
Tell me if I should create a separate issue for this one. For me this seems to be the same core issue. |
Another one related to heredoc, this time Before var = [
{ :type => 'something',
:sql => <<EOF
Select something
from atable
EOF
},
{ :type => 'something',
:sql => <<EOF
Select something
from atable
EOF
}
] After
|
Make ordinary comments from block comments. Related to rubocop#1117.
thanks for the quick fix for the block comment issue. shall I open a new issue for the two heredoc issues I listed here? |
Yes. Probably @jonas054 missed those. — On Thu, May 29, 2014 at 1:06 PM, Eger Andreas notifications@github.com
|
The earlier solution simply avoided auto-correcting every node that contains a block comment. This solution indents as usual but leaves block comments untouched.
So I currently starting to use rubocop on a huge and quite old codebase(>4k files) and as usually thats when bugs starting to appear.
This one is about the IndentationWidth auto-correct code. Have a look at this minimal example:
Before:
Then I run this command on the file
rubocop --only IndentationWidth --auto-correct block_comment_rubocop_example.rb
After the file looks like this and is obviously broken.
(I don't want to discuss the use of block comments, as mentioned old and huge codebase)
The text was updated successfully, but these errors were encountered: