You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurs when running rubocop --auto-correct when attempting to parse class methods with multiline lambdas. The error message is of the form:
An error occurred while Layout/BlockEndNewline cop was inspecting <file>:<row>:<col>
Expected behavior
The Layout/BlockEndNewline cop is able to inspect, register an offense, and correct multiline lambdas without error.
Actual behavior
An error occurs. Partial rubocop --debug output:
An error occurred while Layout/BlockEndNewline cop was inspecting <file>:167:47.
undefined method `heredoc?' for s(:hash,
s(:pair,
s(:sym, :created_at),
s(:sym, :desc))):RuboCop::AST::HashNode
...
An error occurred while Layout/BlockEndNewline cop was inspecting <file>:167:47.
...
Mention the following information in the issue report:
1.33.0 (using Parser 3.1.2.0, rubocop-ast 1.19.1, running on ruby 3.0.4 arm64-darwin21)
Steps to reproduce the problem
Create my_class.rb
Add the following to its body:
class MyClass
thing :widget, -> {
baz(key: val) }
end
An error occurs when running
rubocop --auto-correct
when attempting to parse class methods with multiline lambdas. The error message is of the form:An error occurred while Layout/BlockEndNewline cop was inspecting <file>:<row>:<col>
Expected behavior
The
Layout/BlockEndNewline
cop is able to inspect, register an offense, and correct multiline lambdas without error.Actual behavior
An error occurs. Partial
rubocop --debug
output:Steps to reproduce the problem
my_class.rb
rubocop --auto-correct my_class.rb
RuboCop version
Please see the attached a patch file to the
RuboCop::Cop::Layout::BlockEndNewline
spec which includes a failing test case:Patch file for block_end_newline_spec.rb
The text was updated successfully, but these errors were encountered: