From c6a72c1b830260fd713fa20db4b1a4e845c3d601 Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Mon, 11 Dec 2023 12:49:07 -0700 Subject: [PATCH] v0.11.0 --- CHANGELOG.md | 22 ++++++++++++++++------ README.md | 2 +- mix.exs | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b262da..2be82aa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,20 +4,29 @@ ### Improvements -All styles now deal reasonably with comments. +#### 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). + +* Keep comments in logical places when rewriting if/unless/cond/with (#79, #97, #101, #103) #### With Statements -A slew of improvements for the `with` statement in this release: +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... -* rewrite trivial `lhs <- rhs` to `lhs = rhs` (#86) -* rewrite `with` statements all the way to `if` statements when appropriate -* switch keyword `, do: ` to `do end` rather than wrapping multiple statements in parens +* style trivial pattern matches ala `lhs <- rhs` to `lhs = rhs` (#86) +* style `_ <- rhs` to `rhs` +* style keyword `, do: ` to `do end` rather than wrapping multiple statements in parens +* style statements all the way to `if` statements when appropriate (#100) #### Other * Rewrite `{Map|Keyword}.merge(single_key: value)` to use `put/3` instead (#96) -* Keep comments in logical places when rewriting if/unless/cond/with (#97) + +### Fixes + +* `with`: various edge cases we can only hope no one's encountered and thus never reported + ## v0.10.5 @@ -29,6 +38,7 @@ In short, we now have `assert style(x) == style(style(x))` as part of every test ### Fixes * alias: fix single-module alias deletion newlines bug +* comments: ensure all generated nodes always include line meta (#101) ## v0.10.4 diff --git a/README.md b/README.md index cceaaf78..fb99ed20 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add `:styler` as a dependency to your project's `mix.exs`: ```elixir def deps do [ - {:styler, "~> 0.10", only: [:dev, :test], runtime: false}, + {:styler, "~> 0.11", only: [:dev, :test], runtime: false}, ] end ``` diff --git a/mix.exs b/mix.exs index 71b56731..deff5794 100644 --- a/mix.exs +++ b/mix.exs @@ -12,7 +12,7 @@ defmodule Styler.MixProject do use Mix.Project # Don't forget to bump the README when doing non-patch version changes - @version "0.10.5" + @version "0.11.0" @url "https://github.com/adobe/elixir-styler" def project do