Skip to content

Releases: adobe/elixir-styler

v0.11.2

05 Jan 15:51
Compare
Choose a tag to compare

Fixes

  • pipes: fix unpiping do-blocks into variables when the parent expression is a function invocation
    like a(if x do y end |> z(), b) (Closes #114, h/t @wkirschbaum)

v0.11.1

12 Dec 17:37
Compare
Choose a tag to compare

Fixes

  • with: fix with replacement when it's the only child of a do or -> block (Closes #107, h/t @kerryb -- turns out those edge cases did exist in the wild!)

v0.11.0

12 Dec 01:44
Compare
Choose a tag to compare

Improvements

Comments

Styler will no longer make comments jump around in any situation, and will move comments with the appropriate node in all cases but module directive rearrangement (where they'll just be left behind - sorry! we're still working on it).

  • Keep comments in logical places when rewriting if/unless/cond/with (#79, #97, #101, #103)

with Statements

This release has a slew of improvements for with statements. It's not surprising that there's lots of style rules for with given that just about any case, if, or even cond do could also be expressed as a with. They're very powerful! And with great power...

  • style trivial pattern matches ala lhs <- rhs to lhs = rhs (#86)
  • style _ <- rhs to rhs
  • style keyword , do: to do end rather than wrapping multiple statements in parens
  • rewrite as an if statement when appropriate (#100)

Other

  • Rewrite {Map|Keyword}.merge(single_key: value) to use put/3 instead (#96)

Fixes

  • with: various edge cases we can only hope no one's encountered and thus never reported

v0.10.5

06 Dec 16:35
Compare
Choose a tag to compare

v0.10.5

After being bitten by two of them in a row, Styler's test suite now makes sure that there are no idempotency bugs as part of its tests.

In short, we now have assert style(x) == style(style(x)) as part of every test. Sorry for not thinking to include this before :)

Fixes

  • alias: fix single-module alias deletion newline bug

v0.10.4 -- The Frame.io Contributors Edition!

05 Dec 15:18
Compare
Choose a tag to compare

Improvements

  • alias: delete noop single-module aliases (alias Foo, #87, h/t @mgieger)

Fixes

  • pipes: unnest all pipe starts in one pass (f(g(h(x))) |> j() => x |> h() |> g() |> f() |> j(), #94, h/t @tomjschuster)

v0.10.3

01 Dec 18:01
Compare
Choose a tag to compare

Improvements

  • charlists: leave charlist rewriting to elixir's formatter on elixir >= 1.15 (apparently we aren't the only people who thought that was a good idea!)

Fixes

  • charlists: rewrite empty charlist to use sigil ('' => ~c"")
  • pipes: don't blow up extracting fully-qualified macros (Foo.bar do end |> foo(), #91, h/t @NikitaNaumenko)

v0.10.2

20 Nov 21:33
Compare
Choose a tag to compare

Improvements

  • with: remove identity singleton else clause (eg else {:error, e} -> {:error, e} end, else error -> error end)

v0.10.1

07 Nov 21:13
Compare
Choose a tag to compare

Fixes

  • Fix function head shrink-failures causing comments to jump into blocks (Closes #67, h/t @APB9785)

v0.10.0

01 Nov 19:31
Compare
Choose a tag to compare

Improvements

  • hoist all block-starts to pipes to their own variables (makes styler play better with piped macros)

Fixes

  • fix pipes starting with a macro do-block creating invalid ast (#83, h/t @mhanberg)

v0.9.7

27 Oct 15:50
Compare
Choose a tag to compare

Fixes

  • rewrite pipes starting with quote blocks like we do with case|if|cond|with blocks (#82, h/t @SteffenDE)