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

Unexpected Layout/HeredocIndentation cop on the latest Prism parser #12787

Open
viralpraxis opened this issue Mar 12, 2024 · 2 comments
Open

Comments

@viralpraxis
Copy link
Contributor

Expected behavior

I'm not sure if this is prism's or rubocop's issue, didn't find any related issues

Consider the following heredoc

<<~TXT
  #{1 + 1}
  foo
TXT

I expect Layout/HeredocIndentation not to find anything suspicios.

Actual behavior

C: [Correctable] Layout/HeredocIndentation: Use 2 spaces for indentation in a heredoc. (https://rubystyle.guide#squiggly-heredocs)
      #{1 + 1} ...

Moreover, running with autocorrect just pushes heredoc content to the right indefinetely.

Note that

<<~TXT
  foo
  #{1 + 1}
TXT

does not trigger the cop.

RuboCop version

1.62.1 (using Prism 0.24.0, rubocop-ast 1.31.2, running on ruby 3.3.0) [x86_64-linux]

Prism ref 19177b861e96
@kddnewton
Copy link
Contributor

@andyw8 I think this may have been fixed in latest prism as well, can you check?

@andyw8
Copy link
Contributor

andyw8 commented Apr 25, 2024

The example here is now working, but I'm seeing other failures for this cop - I'll open a separate issue. #12869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants