Skip to content

Commit

Permalink
Closes #133
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed Nov 7, 2024
1 parent 9dc7364 commit 7f65802
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ they can and will change without that change being reflected in Styler's semanti

### Improvements

* `pipes`: pipe-ifies when first arg to a function is a pipe. reach out if this happens in unstylish places in your code (Closes #133)
* `pipes`: unpiping assignments will make the assignment one-line when possible (Closes #181)

### Fixes
Expand Down
24 changes: 24 additions & 0 deletions test/style/pipes_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,30 @@ defmodule Styler.Style.PipesTest do

test "pipifying" do
assert_style "d(a |> b |> c)", "a |> b() |> c() |> d()"

assert_style(
"""
# d
d(
# a
a
# b
|> b
# c
|> c
)
""",
"""
# d
# a
a
# b
|> b()
# c
|> c()
|> d()
"""
)
end
end
end

0 comments on commit 7f65802

Please sign in to comment.