-
-
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
Closing Heredoc Indentation #5406
Comments
Any thoughts here? |
Either |
Sounds good - thanks! I'll see if I can take a look at this this weekend. |
Swell! Feel free to ping me here if you have any questions. |
@Drenmi I opened #5557 and would love comments! I started with |
Will have a look!
Expected so. It's already an insanely complex thing. 🙂 |
This cop checks the indentation of here document closings. ```ruby class Foo def bar <<~SQL 'Hi' SQL end end ``` ```ruby class Foo def bar <<~SQL 'Hi' SQL end end ```
When autocorrecting heredoc indentation, the heredoc close is ignored. I think I would expect it to be realigned with the heredoc open.
The following examples use
as starting code.
Expected behavior
When running rubocop, I'd expect to see a violation for
SQL
needing to be indented two spaces and for the autocorrect to result inActual behavior
Instead, there are no violations.
Steps to reproduce the problem
See above.
RuboCop version
Further Discussion
I'm not sure whether this would fall on the IndentHeredoc rule (which currently only handles the innards of the heredoc), the IndentationWidth rule (which handles the opening), a new ClosingHeredocIndentation rule, or somewhere else. I'd be happy to work on this if given some indication of a preferred location.
The text was updated successfully, but these errors were encountered: