Skip to content

Releases: adobe/elixir-styler

v0.11.8

25 Jan 19:40
Compare
Choose a tag to compare

Two releases in one day!? @koudelka made too good a point about Map.new having some siblings we were ignoring

Improvements

  • pipes: treat MapSet.new and Keyword.new the same way we do Map.new (h/t @koudelka)

v0.11.7

25 Jan 18:14
Compare
Choose a tag to compare

Improvements

  • deprecations: ~R -> ~r, Date.range/2 -> Date.range/3 with decreasing dates (h/t @milmazz)
  • if: rewrite if not x, do: y => unless x, do: y
  • pipes: |> Enum.map(foo) |> Map.new() => |> Map.new(foo)
  • pipes: remove unnecessary then/2 on named function captures: |> then(&foo/1) => |> foo(), |> then(&foo(&1, ...)) => |> foo(...) (thanks to @tfiedlerdejanze for the idea + impl!)

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