Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump styler from 0.11.9 to 1.0.0 #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 1, 2024

Bumps styler from 0.11.9 to 1.0.0.

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, ala A.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, add styler: [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.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, ala A.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, add styler: [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:

</tr></table> 

... (truncated)

Commits
  • ea8c723 1.0.0
  • b3ccc02 Wrap up 1.0.0 docs overhaul
  • 1661f41 minor optimization
  • 3769ffb ignore no-paren, no-body function heads. closes #185
  • 95fba17 handle block bodies in with statement replacement
  • c95b0ba Rewrite with true <- ... to if statements. Closes #173
  • 0df8bc8 replace with statements with no arrows. closes #174
  • aee6e71 Allow Kernel unary ! and not as valid pipe starts. Closes #183
  • 388f2d8 fix RedundantWithClauseResult creating invalid with statements when there are...
  • c16d3a9 Merge pull request #178 from tfiedlerdejanze/tf-random-corrections
  • Additional commits viewable in compare view

Dependabot compatibility score

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)

Bumps [styler](https://github.com/adobe/elixir-styler) from 0.11.9 to 1.0.0.
- [Release notes](https://github.com/adobe/elixir-styler/releases)
- [Changelog](https://github.com/adobe/elixir-styler/blob/main/CHANGELOG.md)
- [Commits](adobe/elixir-styler@v0.11.9...v1.0.0)

---
updated-dependencies:
- dependency-name: styler
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Sep 1, 2024
@dependabot dependabot bot requested a review from g-andrade September 1, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants