Skip to content

Commit 8d533bd

Browse files
Update to Elixir 1.19 (#1603)
* Update to Elixir 1.19 * Upgrade doctest_formatter * Attempt to fix dialyzer warnings * Upgrade Elixir and dialyxir * Remove special mentions of 1.15
1 parent 6f2c5fa commit 8d533bd

File tree

9 files changed

+17
-31
lines changed

9 files changed

+17
-31
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
runs-on: ubuntu-24.04
1818
strategy:
1919
matrix:
20-
elixir: [1.18.1]
21-
otp: [27.2]
20+
elixir: [1.19.2]
21+
otp: [28.1]
2222

2323
steps:
2424
- name: Checkout code
@@ -76,8 +76,6 @@ jobs:
7676
strategy:
7777
matrix:
7878
include:
79-
- elixir: '1.14.0'
80-
otp: '25.0'
8179
- elixir: '1.15.0'
8280
otp: '26.0'
8381
- elixir: '1.16.0'
@@ -86,6 +84,8 @@ jobs:
8684
otp: '27.0'
8785
- elixir: '1.18.1'
8886
otp: '27.2'
87+
- elixir: '1.19.2'
88+
otp: '28.1'
8989

9090
steps:
9191
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Setup
1010

11-
The exercises currently target Elixir versions from 1.14 to 1.18 and Erlang/OTP versions from 25 to 27. Detailed installation instructions can be found at
11+
The exercises currently target Elixir versions from 1.15 to 1.19 and Erlang/OTP versions from 25 to 27. Detailed installation instructions can be found at
1212
[https://elixir-lang.org/install.html](https://elixir-lang.org/install.html). We recommend using the [asdf version manager](https://github.com/asdf-vm/asdf) to manage multiple Elixir versions.
1313

1414
## Testing

concepts/mapsets/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ MapSet.symmetric_difference(b, a)
6666
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
6767
```
6868

69-
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
69+
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.
7070

7171
```elixir
7272
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

concepts/mapsets/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ MapSet.symmetric_difference(b, a)
6666
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
6767
```
6868

69-
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
69+
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.
7070

7171
```elixir
7272
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

exercises/concept/gotta-snatch-em-all/.docs/hints.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
## 8. Shiny for the win
4949

50-
- Use [this `MapSet` function][split_with] to separate your collection (from Elixir 1.15, otherwise, [this][filter] and [that][reject] function can be used instead)
50+
- Use [this `MapSet` function][split_with] to separate your collection
5151
- Use [this `String` function][starts_with] to detect shiny cards
5252
- [This `MapSet` function][to_list] can create a list
5353
- `MapSet`s do not have a notion of order, you should use [this `Enum` function][sort] to sort the cards, even if the tests pass without it
@@ -64,8 +64,6 @@
6464
[new_empty]: https://hexdocs.pm/elixir/MapSet.html#new/0
6565
[union]: https://hexdocs.pm/elixir/MapSet.html#union/2
6666
[split_with]: https://hexdocs.pm/elixir/MapSet.html#split_with/2
67-
[filter]: https://hexdocs.pm/elixir/MapSet.html#filter/2
68-
[reject]: https://hexdocs.pm/elixir/MapSet.html#reject/2
6967
[starts_with]: https://hexdocs.pm/elixir/String.html#starts_with?/2
7068
[enum]: https://hexdocs.pm/elixir/Enum.html
7169
[reduce]: https://hexdocs.pm/elixir/Enum.html#reduce/3

exercises/concept/gotta-snatch-em-all/.docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ MapSet.symmetric_difference(b, a)
6868
# => MapSet.new([2, 3, 4, 5, 6, 7, 8, 9, 100])
6969
```
7070

71-
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2` (from Elixir 1.15).
71+
You can filter and partition sets with `MapSet.filter/2`, `MapSet.reject/2` and `MapSet.split_with/2`.
7272

7373
```elixir
7474
a = MapSet.new([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

exercises/concept/gotta-snatch-em-all/.meta/exemplar.ex

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,11 @@ defmodule GottaSnatchEmAll do
6262

6363
@spec split_shiny_cards(collection()) :: {[card()], [card()]}
6464
def split_shiny_cards(collection) do
65-
{shiny, not_shiny} = split_with(collection, &String.starts_with?(&1, "Shiny"))
65+
{shiny, not_shiny} = MapSet.split_with(collection, &String.starts_with?(&1, "Shiny"))
6666

6767
shiny_list = shiny |> MapSet.to_list() |> Enum.sort()
6868
not_shiny_list = not_shiny |> MapSet.to_list() |> Enum.sort()
6969

7070
{shiny_list, not_shiny_list}
7171
end
72-
73-
# MapSet.split_with/2 was added in Elixir 1.15 - Switch to that when it becomes the minimum version
74-
defp split_with(mapset, predicate) do
75-
init = {MapSet.new(), MapSet.new()}
76-
77-
Enum.reduce(mapset, init, fn item, {passes, fails} ->
78-
if predicate.(item) do
79-
{MapSet.put(passes, item), fails}
80-
else
81-
{passes, MapSet.put(fails, item)}
82-
end
83-
end)
84-
end
8572
end

mix.exs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ defmodule ExercismTestRunner.Mixfile do
1313
paths: ["_build"],
1414
plt_core_path: "priv/plts",
1515
plt_file: {:no_warn, "priv/plts/eventstore.plt"},
16-
ignore_warnings: ".dialyzer_ignore.exs"
16+
ignore_warnings: ".dialyzer_ignore.exs",
17+
flags: [:no_opaque]
1718
]
1819
]
1920
end
@@ -24,9 +25,9 @@ defmodule ExercismTestRunner.Mixfile do
2425

2526
defp deps do
2627
[
27-
{:dialyxir, "~> 1.3.0", runtime: false},
28+
{:dialyxir, "~> 1.4.7", runtime: false},
2829
{:markdown_code_block_formatter, "~> 0.1.0", runtime: false},
29-
{:doctest_formatter, "~> 0.2.0", runtime: false}
30+
{:doctest_formatter, "~> 0.4.0", runtime: false}
3031
]
3132
end
3233
end

mix.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%{
2-
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
3-
"doctest_formatter": {:hex, :doctest_formatter, "0.2.0", "fe6198e8d81d833269314696b5bb55c0db0e16f609de53cdcafe1758f53ecf6c", [:mix], [], "hexpm", "34fb0da7cbb704d5caf477e77268fcf7ee9c87e13d94a04ea1865afb9e82e3f5"},
4-
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
2+
"dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"},
3+
"doctest_formatter": {:hex, :doctest_formatter, "0.4.1", "c69bf93853d1ec5785cbd22dcf0c2bd4dd357cc53f2e89d05850eed7e985462a", [:mix], [], "hexpm", "c1b07495a524126de133be4e077b28c4a2d8e1a14c9eeca962482e2067b5b068"},
4+
"erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"},
55
"markdown_code_block_formatter": {:hex, :markdown_code_block_formatter, "0.1.0", "1eb35408f0ce2cbd40086fea5bbb2aebbb4805ffc2c967f9e54aa724fa4bd222", [:mix], [], "hexpm", "ce27a7c7497074c48941c1d74ab9c39a08db31f2875b867c6d5671d7d70682b0"},
66
}

0 commit comments

Comments
 (0)