Skip to content

Ruby heredoc should not be considered for Style/EndlessMethod #14602

@hlascelles

Description

@hlascelles

Steps to reproduce the problem

Create a method with a squiggly heredoc, and enforce Style/EndlessMethod

def foo
  puts <<~MSG
    Hello
  MSG
end

Expected behavior

It should (probably?) not fire.

Actual behavior

We see a hit:

Image

RuboCop version

1.81.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions