Skip to content

v1.4.0

Compare
Choose a tag to compare
@novaugust novaugust released this 21 Feb 19:10
· 9 commits to main since this release

Improvements

Alias Lifting

This release taught Styler to try just that little bit harder when doing alias lifting.

  • general improvements around conflict detection, lifting in more correct places and fewer incorrect places (#193, h/t @jsw800)

  • use knowledge of existing aliases to shorten invocations (#201, h/t me)

    example:

      alias A.B.C
    
      A.B.C.foo()
    

    becomes:

      alias A.B.C
    
      C.foo()
    

Struct Updates => Map Updates

1.19 deprecates struct update syntax in favor of map update syntax.

# This
%Struct{x | y}
# Styles to this
%{x | y}

WARNING Double check your diffs to make sure your variable is pattern matching against the same struct if you want to harness 1.19's type checking features. Apologies to folks who hoped Styler would do this step for you <3 (#199, h/t @SteffenDE)

Ex1.17+

  • Replace :timer.units(x) with the new to_timeout(unit: x) for hours|minutes|seconds (This style is only applied if you're on 1.17+)

Fixes

  • pipes: handle pipifying when the first arg is itself a pipe: c(a |> b, d) => a |> b() |> c(d) (#214, h/t @kybishop)
  • pipes: handle pipifying nested functions d(c(a |> b)) => a |> b |> c() |> d (#216, h/t @emkguts)
  • with: fix a stabby with , else: (_ -> :ok) being rewritten to a case (#219, h/t @iamhassangm)