Skip to content

Unexpected EOF formatting #488

Description

@adfoster-r7

Hi there; Thanks for the gem!

With the following test_case.rb file:

let(:valid_data) do
  Base64.decode64 <<~EOF
    aGVsbG8gd29ybGQK
  EOF
end

And running the command:

bundle exec stree format --print-width=100 ./test_case.rb

The resulting code appears to be less intuitive to read:

let(:valid_data) { Base64.decode64 <<~EOF }
    aGVsbG8gd29ybGQK
  EOF

Expected result:

let(:valid_data) do
  Base64.decode64 <<~EOF
    aGVsbG8gd29ybGQK
  EOF
end

Versions:

$ ruby --version
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-darwin23]

$ bundle exec stree version                                
6.2.0

Apologies if I've reported this issue to the wrong repo or I've misunderstood the output; thanks!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions