Skip to content

Commit f09321a

Browse files
committed
v1.0.0-rc.1
1 parent ef585a4 commit f09321a

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ they can and will change without that change being reflected in Styler's semanti
55

66
## main
77

8-
### Fixes
8+
## 1.0.0-rc.1
9+
10+
11+
### Improvements
912

10-
* rewrite `a |> Enum.map(m) |> Enum.join()` to `map_join(a, m)`. we already did this for `join/2`, but missed the case for `join/1`
13+
* Lots of documentation added. Nearly done and ready for 1.0.0.
14+
* `Enum.into(x, [])` => `Enum.to_list(x)`
15+
* `Enum.into(x, [], mapper)` => `Enum.map(x, mapper)`
16+
* `a |> Enum.map(m) |> Enum.join()` to `map_join(a, m)`. we already did this for `join/2`, but missed the case for `join/1`
1117

1218
## 1.0.0-rc.0
1319

@@ -101,8 +107,6 @@ See the moduledoc for `Styler.Style.Configs` for more.
101107
* `Map.drop(foo, [single_key])` => `Map.delete(foo, single_key)` #161 (also in pipes)
102108
* `Keyword.drop(foo, [single_key])` => `Keyword.delete(foo, single_key)` #161 (also in pipes)
103109
* `lhs |> Enum.reverse() |> Kernel.++(enum)` => `lhs |> Enum.reverse(enum)`
104-
* `Enum.into(x, [])` => `Enum.to_list(x)`
105-
* `Enum.into(x, [], mapper)` => `Enum.map(x, mapper)`
106110

107111
### Fixes
108112

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ You can learn more about the history, purpose and implementation of Styler from
88
## Features
99

1010
- auto-fixes [many credo rules](docs/credo.md), meaning you can turn them off to speed credo up
11-
- [keeping a strict module layout](docs/module_directives.md#directive-organization)
12-
- alphabetizing module directives
13-
- [extracting repeated aliases](docs/moduledirectives.md#alias-lifting)
14-
- piping and unpiping function calls based on the number of functons
15-
- optimizing standard library calls (`a |> Enum.map(m) |> Enum.into(Map.new)` => `Map.new(a, m)`)
16-
- using sigils for strings with many escaped quotes `\"`
17-
- ... and so many other things.
11+
- [keeps a strict module layout](docs/module_directives.md#directive-organization)
12+
- alphabetizes module directives
13+
- [extracts repeated aliases](docs/module_directives.md#alias-lifting)
14+
- pipes and unpipes function calls based on the number of calls
15+
- optimizes standard library calls (`a |> Enum.map(m) |> Enum.into(Map.new)` => `Map.new(a, m)`)
16+
- replaces strings with sigils when the string has many escaped quotes
17+
- ... and so much more
1818

1919
[See our Rewrites documentation on hexdocs for all the nitty-gritty on what all Styler does](https://hexdocs.pm/styler/)
2020

@@ -37,7 +37,7 @@ Add `:styler` as a dependency to your project's `mix.exs`:
3737
```elixir
3838
def deps do
3939
[
40-
{:styler, "~> 1.0.0-rc.0", only: [:dev, :test], runtime: false},
40+
{:styler, "~> 1.0.0-rc.1", only: [:dev, :test], runtime: false},
4141
]
4242
end
4343
```

docs/styles.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,17 @@ This rewrite is applied when the collectable is a new map, keyword list, or maps
3535

3636
This is an improvement for the reader, who gets a more natural language expression: "make a new map from enum" vs "enumerate enum and collect its elements into a new map"
3737

38+
Note that all of the examples below also apply to pipes (`enum |> Enum.into(...)`)
39+
3840
| Before | After |
3941
|--------|-------|
40-
| `Enum.into(a, %{})` | `Map.new(enum)`|
42+
| `Enum.into(enum, %{})` | `Map.new(enum)`|
4143
| `Enum.into(enum, Map.new())` | `Map.new(enum)`|
4244
| `Enum.into(enum, Keyword.new())` | `Keyword.new(enum)`|
4345
| `Enum.into(enum, MapSet.new())` | `Keyword.new(enum)`|
4446
| `Enum.into(enum, %{}, fn x -> {x, x} end)` | `Map.new(enum, fn x -> {x, x} end)`|
47+
| `Enum.into(enum, [])` | `Enum.to_list(enum)` |
48+
| `Enum.into(enum, [], mapper)` | `Enum.map(enum, mapper)`|
4549

4650
## Map/Keyword.merge w/ single key literal -> X.put
4751

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Styler.MixProject do
1212
use Mix.Project
1313

1414
# Don't forget to bump the README when doing non-patch version changes
15-
@version "1.0.0-rc.0"
15+
@version "1.0.0-rc.1"
1616
@url "https://github.com/adobe/elixir-styler"
1717

1818
def project do

0 commit comments

Comments
 (0)