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

Layout/LineContinuationSpacing applies to non-Ruby source (DATA section) #10763

Closed
Bo98 opened this issue Jun 28, 2022 · 0 comments · Fixed by #10765
Closed

Layout/LineContinuationSpacing applies to non-Ruby source (DATA section) #10763

Bo98 opened this issue Jun 28, 2022 · 0 comments · Fixed by #10765
Labels

Comments

@Bo98
Copy link

Bo98 commented Jun 28, 2022

The new Layout/LineContinuationSpacing cop incorrectly applies itself to text after __END__.


Expected behavior

The cop is not raised for non-Ruby code.

Actual behavior

The cop is triggered.

Steps to reproduce the problem

# frozen_string_literal: true

class ThisIsRubyCode
  def initialize
    puts "Hello"
  end
end

__END__
random text, such as a git diff           \
which should not be checked

RuboCop version

$ [bundle exec] rubocop -V
1.31.0 (using Parser 3.1.2.0, rubocop-ast 1.18.0, running on ruby 2.6.8 x86_64-darwin15)
  - rubocop-performance 1.14.2
  - rubocop-rails 2.15.0
@koic koic added the bug label Jun 28, 2022
koic added a commit to koic/rubocop that referenced this issue Jun 28, 2022
…Spacing`

Fixes rubocop#10763.

This PR fixes a false positive for `Layout/LineContinuationSpacing`
when using continuation keyword `\` after `__END__`.
bbatsov pushed a commit that referenced this issue Jun 29, 2022
Fixes #10763.

This PR fixes a false positive for `Layout/LineContinuationSpacing`
when using continuation keyword `\` after `__END__`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants