Skip to content

Releases: adobe/elixir-styler

v0.11.6

25 Jan 18:13
Compare
Choose a tag to compare

Fixes

  • directives: maintain order of module compilation callbacks (@before_compile etc) relative to use statements (Closes #120, h/t @frankdugan3)

v0.11.5

18 Jan 14:34
Compare
Choose a tag to compare

Fixes

  • deprecations: fix parsing ranges with non-integer bounds like x..y (Closes #119, h/t @maennchen)

v0.11.4

17 Jan 21:08
Compare
Choose a tag to compare

Improvements

Shoutout @milmazz for all the deprecation work below =)

  • Deprecations: Rewrite 1.16 Deprecations (h/t @milmazz for all the work here)
    • add //1 step to Enum.slice/2|String.slice/2 with decreasing ranges
    • File.stream!(file, options, line_or_bytes) => File.stream!(file, line_or_bytes, options)
  • Deprecations: Path.safe_relative_to/2 => Path.safe_relative/2

v0.11.3

08 Jan 18:26
Compare
Choose a tag to compare

Fixes

  • directives: fix infinite loop when encountering @spec import(...) :: ... (Closes #115, h/t @kerryb)
  • with: fix deletion of arrow-less with statements within function invocations

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)