Releases: adobe/elixir-styler
v0.11.8
v0.11.7
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
v0.11.5
v0.11.4
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 toEnum.slice/2|String.slice/2
with decreasing ranges File.stream!(file, options, line_or_bytes)
=>File.stream!(file, line_or_bytes, options)
- add
- Deprecations:
Path.safe_relative_to/2
=>Path.safe_relative/2
v0.11.3
v0.11.2
v0.11.1
v0.11.0
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).
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
tolhs = rhs
(#86) - style
_ <- rhs
torhs
- style keyword
, do:
todo 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 useput/3
instead (#96)
Fixes
with
: various edge cases we can only hope no one's encountered and thus never reported
v0.10.5
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