Skip to content

Releases: adobe/elixir-styler

v0.7.1

10 May 23:18
Compare
Choose a tag to compare

Features

  • Rewrite case ... true / else -> to be if statements

v0.7.0

09 May 21:21
Compare
Choose a tag to compare

Features

  • Enum.reverse/2 optimizations
    • Rewrite Enum.reverse(foo) ++ bar to Enum.reverse(foo, bar)
    • Rewrite a |> Enum.reverse() |> Enum.concat(enum) to Enum.reverse(a, enum)
  • Rewrite |> (& ...).() to |> then(& ...) (Credo.Check.Readability.PipeIntoAnonymousFunctions)
  • Add parens to 1-arity pipe functions (Credo.Check.Readability.OneArityFunctionInPipe)

v0.6.1

07 May 21:13
Compare
Choose a tag to compare

Improvements

  • Better error handling: mix format will still format files if a style fails

Fixes

  • mix style: only run on .ex and .exs files
  • ModuleDirectives: now expands alias __MODULE__.{A, B} (h/t @adriankumpf)

v0.6.0

04 May 21:08
Compare
Choose a tag to compare

Features

  • mix style: brought back to life for folks who want to incrementally introduce Styler

Fixes

  • Styler.Style.Pipes:
    • include x in y and ^foo (for ecto) as a valid pipe starts
    • work even harder to keep rewrites on one line

v0.5.2

04 May 16:28
Compare
Choose a tag to compare

Fixes

  • ModuleDirectives: hande dynamic module names, like var = Foo; defmodule var, do: ...
  • Pipes: include Ecto.Query.from and Query.from as valid pipe starts (h/t @Nezteb)

v0.5.1

26 Apr 14:16
Compare
Choose a tag to compare

Improvements

Optimized styling just the littlest bit

v0.5.0

25 Apr 19:13
Compare
Choose a tag to compare

Improvements

  • Styler now implements Mix.Task.Format, meaning it is now an Elixir formatter plugin.
    See the README for new installation & usage instructions

Breaking Change! Wooo!

  • the mix style task has been removed

v0.4.1

24 Apr 19:34
Compare
Choose a tag to compare

Improvements

  • Pipes rewrites |> Enum.into(%{}[, mapper]) and Enum.into(Map.new()[, mapper]) to Map.new/1,2 calls

v0.4.0

24 Apr 19:09
Compare
Choose a tag to compare

Improvements

  • Pipes rewrites some two-step processes into one, fixing these credo issues in pipe chains:
    • Credo.Check.Refactor.FilterCount
    • Credo.Check.Refactor.MapJoin
    • Credo.Check.Refactor.MapInto

Fixes

  • ModuleDirectives handles even weirder places to hide your aliases (anonymous functions, in this case)
  • Pipes tries even harder to keep single-pipe rewrites of invocations on one line

v0.3.1

16 Apr 16:04
Compare
Choose a tag to compare

Fixes

  • Pipes
    • fixed omission of == as a valid pipe start operator (h/t @peake100 for the issue)
    • fixed rewrite of a |> b, where b was invoked without parenthesis