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

False positive Layout/EmptyLinesAroundArguments with multiline heredoc args #5339

Closed
jacobpgn opened this issue Dec 28, 2017 · 0 comments
Closed

Comments

@jacobpgn
Copy link

Layout/EmptyLinesAroundArguments appears to fail incorrectly when a method is called with both:

  1. a multiline heredoc as an argument (or part of an argument, e.g. as a hash value)
  2. a chained method which also receives arguments

Expected behavior

I would expect the following to not fail for this cop:

def chocolate
  bar(<<~DOCS)
    Sometimes we foo the bars

    Other times the bars foo us
  DOCS
    .call!(true)
end

Actual behavior

C: Layout/EmptyLinesAroundArguments: Empty line detected around arguments 💥

Steps to reproduce the problem

See example in Expected behaviour.

RuboCop version

0.52.1 (using Parser 2.4.0.2, running on ruby 2.5.0 x86_64-darwin16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant