sqids-elixir
sqids-elixir copied to clipboard
Bump styler from 0.11.9 to 1.1.1
Bumps styler from 0.11.9 to 1.1.1.
Release notes
Sourced from styler's releases.
v1.0.0
1.0.0
Styler's two biggest outstanding bugs have been fixed, both related to compilation breaking during module directive organization. One was references to aliases being moved above where the aliases were declared, and the other was similarly module directives being moved after their uses in module directives.
In both cases, Styler is now smart enough to auto-apply the fixes we recommended in the old Readme.
Other than that, a slew of powerful new features have been added, the neatest one (in the author's opinion anyways) being Alias Lifting.
Thanks to everyone who reported bugs that contributed to all the fixes released in 1.0.0 as well.
Improvements
Alias Lifting
Along the lines of
Credo.Check.Design.AliasUsage
, Styler now "lifts" deeply nested aliases (depth >= 3, alaA.B.C....
) that are used more than once.Put plainly, this code:
defmodule A do def lift_me() do A.B.C.foo() A.B.C.baz() end end
will become
defmodule A do @moduledoc false alias A.B.C
def lift_me do C.foo() C.baz() end end
To exclude modules ending in
.Foo
from being lifted, addstyler: [alias_lifting_exclude: [Foo]]
to your.formatter.exs
Module Attribute Lifting
A long outstanding breakage of a first pass with Styler was breaking directives that relied on module attributes which Styler moved after their uses. Styler now detects these potential breakages and automatically applies our suggested fix, which is creating a variable before the module. This usually happened when folks were using a library that autogenerated their moduledocs for them.
In code, this module:
... (truncated)
Changelog
Sourced from styler's changelog.
1.1.1
Improvements
unless
: rewriteunless a |> b |> c
asunless !(a |> b() |> c())
rather thanunless a |> b() |> c() |> Kernel.!()
(h/t@gregmefford
)1.1.0
Improvements
The big change here is the rewrite/removal of
unless
due to unless "eventually" being deprecated. Thanks to@janpieper
and@ypconstante
for bringing this up in #190.
unless
: rewrite allunless
toif
(#190)pipes
: optimize|> Stream.{each|map}(fun) |> Stream.run()
to|> Enum.each(fun)
Fixes
pipes
: optimizations reducing 2 pipes to 1 no longer squeeze all pipes onto one line (#180)if
: fix infinite loop rewriting negated if with empty do bodyif x != y, do: (), else: :ok
(#196, h/t@itamm15
)1.0.0
Styler's two biggest outstanding bugs have been fixed, both related to compilation breaking during module directive organization. One was references to aliases being moved above where the aliases were declared, and the other was similarly module directives being moved after their uses in module directives.
In both cases, Styler is now smart enough to auto-apply the fixes we recommended in the old Readme.
Other than that, a slew of powerful new features have been added, the neatest one (in the author's opinion anyways) being Alias Lifting.
Thanks to everyone who reported bugs that contributed to all the fixes released in 1.0.0 as well.
Improvements
Alias Lifting
Along the lines of
Credo.Check.Design.AliasUsage
, Styler now "lifts" deeply nested aliases (depth >= 3, alaA.B.C....
) that are used more than once.Put plainly, this code:
defmodule A do def lift_me() do A.B.C.foo() A.B.C.baz() end end
will become
</tr></table>
... (truncated)
Commits
4aa18ba
Don't pipe intoKernel.!
when rewriting unless with pipes79dce09
update version in readme42b5d40
v1.1.09125157
actually, lets only donot
forin
926ad51
usenot
over!
when rewritingunless a (> >= < <= in) b
cde90d3
Remove unless from codebases (#194)d6c90cd
fix infinite loop rewriting negated if with empty do body. closes #196f2b269e
Add Stream.run optimizations, fix optimizations shrinking pipes to one line (...b4bca9c
Merge pull request #192 from ktekinay/feature/fix-style-examplef53cf7c
Update styles.md- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebase
will rebase this PR -
@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it -
@dependabot merge
will merge this PR after your CI passes on it -
@dependabot squash and merge
will squash and merge this PR after your CI passes on it -
@dependabot cancel merge
will cancel a previously requested merge and block automerging -
@dependabot reopen
will reopen this PR if it is closed -
@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency -
@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)