Skip to content

Commit 8c5d919

Browse files
committed
v1.9.0
1 parent 6722b19 commit 8c5d919

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

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

66
## main
77

8+
## 1.9.0
9+
10+
This was a weird one, but I found myself often writing `to_timeout` with plural units and then having to go back and fix
11+
the code to be singular units instead. Polling a few colleagues, it seemed I wasn't alone in that mistake. So for the first time,
12+
Styler will correct code that would otherwise produce a runtime error, saving you from flow-breaking backtracking.
13+
814
### Improvements
915

1016
`to_timeout` improvements:
1117

12-
- translate plural units to singular `to_timeout(hours: 1)` -> `to_timeout(hour: 1)` (plurals raise runtime errors)
13-
- run transformations even when there are multiple args `to_timeout(hours: 24 * 1, seconds: 60 * 4)` -> `to_timeout(day: 1, minute: 4)`. this can result in a runtime error due to duplicate keys, as in the following scenario: `to_timeout(minute: 60, hours: 3)` -> `to_timeout(hour: 1, hour: 3)`
18+
- translate plural units to singular `to_timeout(hours: 2)` -> `to_timeout(hour: 2)` (plurals are valid ast, but invalid arguments to this function)
19+
- transform when there are multiple keys: `to_timeout(hours: 24 * 1, seconds: 60 * 4)` -> `to_timeout(day: 1, minute: 4)`. **this can introduce runtime bugs** due to duplicate keys, as in the following scenario: `to_timeout(minute: 60, hours: 3)` -> `to_timeout(hour: 1, hour: 3)`
1420

1521
## 1.8.0
1622

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Add `:styler` as a dependency to your project's `mix.exs`:
4848
```elixir
4949
def deps do
5050
[
51-
{:styler, "~> 1.8", only: [:dev, :test], runtime: false},
51+
{:styler, "~> 1.9", only: [:dev, :test], runtime: false},
5252
]
5353
end
5454
```

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.8.0"
15+
@version "1.9.0"
1616
@url "https://github.com/adobe/elixir-styler"
1717

1818
def project do

0 commit comments

Comments
 (0)