Closed
Description
Hello! 👋 Thanks for this awesome Elixir tool! We encountered an interesting bug while applying Styler to our codebase. It seems that in certain situations, Styler leaves behind an empty with
block wrapping the result.
I plan on looking into this myself when I have a bit of time, but I figured creating the issue would be helpful for tracking in any case.
Versions
- Elixir: 1.16.0 and 1.17.2
- Styler: Latest commit
c16d3a91e489d043738e2b3bf5c12b6e6357e80c
Example Input
This test case can replicate the issue:
test "bug in with rewrite" do
assert_style(
"""
with foo <- do_stuff(value),
{:ok, result} <- do_more_stuff(bar, baz) do
{:ok, result}
end
""",
"""
foo = do_stuff(value)
do_more_stuff(bar, baz)
"""
)
end
Stacktrace / Current Behaviour
Styling produced unexpected results
expected:
foo = do_stuff(value)
do_more_stuff(bar, baz)
styled:
foo = do_stuff(value)
with do
do_more_stuff(bar, baz)
end
Metadata
Metadata
Assignees
Labels
No labels