v1.4.0
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 newto_timeout(unit: x)
forhours|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 functionsd(c(a |> b))
=>a |> b |> c() |> d
(#216, h/t @emkguts)with
: fix a stabbywith
, else: (_ -> :ok)
being rewritten to a case (#219, h/t @iamhassangm)