Skip to content

Commit

Permalink
Update to Elixir 1.17 (#430)
Browse files Browse the repository at this point in the history
* update submodule

* update to 1.17

* typo

* more typo

* update deps

* typo again

* fix credo complaints
  • Loading branch information
jiegillet authored Jun 30, 2024
1 parent 381cce3 commit f3e6767
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 24 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/elixir_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-22.04

container:
image: hexpm/elixir:1.16.0-erlang-26.2.1-debian-bookworm-20231009
image: hexpm/elixir:1.17.0-erlang-27.0-debian-bookworm-20240612

steps:
- name: Install git
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
id: plt-cache
with:
path: priv/plts
key: elixir:1.16.0-erlang-26.2.1-debian-bookworm-20231009-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-v3
key: elixir:1.17.0-erlang-27.0-debian-bookworm-20240612-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-v3

- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
Expand All @@ -73,4 +73,3 @@ jobs:

- name: Run Smoke Test in Docker
run: bin/run-tests-in-docker.sh

2 changes: 1 addition & 1 deletion .github/workflows/elixir_test_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-22.04

container:
image: hexpm/elixir:1.16.0-erlang-26.2.1-debian-bookworm-20231009
image: hexpm/elixir:1.17.0-erlang-27.0-debian-bookworm-20240612

steps:
- name: Install git
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.16.0-otp-26
erlang 26.2.1
elixir 1.17.0-otp-27
erlang 27.0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM hexpm/elixir:1.16.0-erlang-26.2.1-debian-bookworm-20231009 as builder
FROM hexpm/elixir:1.17.0-erlang-27.0-debian-bookworm-20240612 as builder

RUN apt-get update && \
apt-get install bash -y
Expand All @@ -13,7 +13,7 @@ COPY . .
# Builds an escript bin/elixir_analyzer
RUN ./bin/build.sh

FROM hexpm/elixir:1.16.0-erlang-26.2.1-debian-bookworm-20231009
FROM hexpm/elixir:1.17.0-erlang-27.0-debian-bookworm-20240612
COPY --from=builder /etc/passwd /etc/passwd

COPY --from=builder /elixir-analyzer/bin /opt/analyzer/bin
Expand Down
6 changes: 5 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ config :logger, :console,
:analysis_module,
:code_file_path,
:error_message,
:file_name
:file_name,
:exemploid_files,
:submitted_files,
:data,
:exercise_type
]

# It is also possible to import configuration files, relative to this
Expand Down
2 changes: 1 addition & 1 deletion elixir
Submodule elixir updated 88 files
+1 −1 .formatter.exs
+10 −10 .github/workflows/ci.yml
+13 −57 .github/workflows/no-important-files-changed.yml
+1 −1 CODE_OF_CONDUCT.md
+1 −1 concepts/enum/introduction.md
+2 −2 concepts/processes/introduction.md
+6 −2 concepts/with/links.json
+15 −15 config.json
+1 −1 exercises/concept/boutique-inventory/.docs/introduction.md
+1 −0 exercises/concept/boutique-suggestions/.docs/instructions.md
+2 −2 exercises/concept/dancing-dots/.docs/hints.md
+2 −0 exercises/concept/log-parser/test/log_parser_test.exs
+1 −1 exercises/concept/take-a-number-deluxe/.docs/instructions.md
+3 −1 exercises/concept/take-a-number/.docs/hints.md
+2 −2 exercises/concept/take-a-number/.docs/introduction.md
+2 −2 exercises/practice/accumulate/.meta/example.ex
+2 −2 exercises/practice/accumulate/lib/accumulate.ex
+8 −13 exercises/practice/all-your-base/.docs/instructions.md
+8 −0 exercises/practice/all-your-base/.docs/introduction.md
+1 −3 exercises/practice/alphametics/.docs/instructions.md
+1 −1 exercises/practice/alphametics/.meta/config.json
+3 −3 exercises/practice/anagram/.docs/instructions.md
+12 −0 exercises/practice/anagram/.docs/introduction.md
+6 −0 exercises/practice/anagram/.meta/tests.toml
+19 −0 exercises/practice/anagram/test/anagram_test.exs
+5 −7 exercises/practice/bank-account/.docs/instructions.md
+20 −0 exercises/practice/bank-account/.docs/introduction.md
+13 −3 exercises/practice/change/.meta/tests.toml
+7 −0 exercises/practice/change/test/change_test.exs
+8 −8 exercises/practice/complex-numbers/.meta/example.ex
+8 −8 exercises/practice/complex-numbers/lib/complex_numbers.ex
+3 −3 exercises/practice/darts/.docs/hints.md
+2 −2 exercises/practice/darts/.docs/instructions.md
+1 −1 exercises/practice/darts/.meta/config.json
+6 −5 exercises/practice/dnd-character/.docs/instructions.md
+10 −0 exercises/practice/dnd-character/.docs/introduction.md
+0 −0 exercises/practice/eliuds-eggs/.docs/instructions.md
+0 −0 exercises/practice/eliuds-eggs/.docs/introduction.md
+0 −0 exercises/practice/eliuds-eggs/.formatter.exs
+0 −0 exercises/practice/eliuds-eggs/.gitignore
+2 −2 exercises/practice/eliuds-eggs/.meta/config.json
+1 −1 exercises/practice/eliuds-eggs/.meta/example.ex
+0 −0 exercises/practice/eliuds-eggs/.meta/tests.toml
+1 −1 exercises/practice/eliuds-eggs/lib/eliuds_eggs.ex
+2 −2 exercises/practice/eliuds-eggs/mix.exs
+29 −0 exercises/practice/eliuds-eggs/test/eliuds_eggs_test.exs
+0 −0 exercises/practice/eliuds-eggs/test/test_helper.exs
+1 −1 exercises/practice/flatten-array/.docs/instructions.md
+1 −1 exercises/practice/flatten-array/.meta/example.ex
+1 −1 exercises/practice/flatten-array/lib/flatten_array.ex
+2 −2 exercises/practice/go-counting/.docs/instructions.md
+15 −17 exercises/practice/kindergarten-garden/.docs/instructions.md
+6 −0 exercises/practice/kindergarten-garden/.docs/introduction.md
+5 −15 exercises/practice/knapsack/.docs/instructions.md
+8 −0 exercises/practice/knapsack/.docs/introduction.md
+1 −1 exercises/practice/leap/.approaches/introduction.md
+9 −26 exercises/practice/meetup/.docs/instructions.md
+29 −0 exercises/practice/meetup/.docs/introduction.md
+1 −2 exercises/practice/meetup/.meta/config.json
+7 −13 exercises/practice/minesweeper/.docs/instructions.md
+5 −0 exercises/practice/minesweeper/.docs/introduction.md
+1 −1 exercises/practice/parallel-letter-frequency/.docs/instructions.md
+39 −13 exercises/practice/pig-latin/.docs/instructions.md
+8 −0 exercises/practice/pig-latin/.docs/introduction.md
+3 −28 exercises/practice/pig-latin/test/pig_latin_test.exs
+0 −29 exercises/practice/pop-count/test/pop_count_test.exs
+1 −1 exercises/practice/raindrops/.meta/config.json
+8 −37 exercises/practice/roman-numerals/.docs/instructions.md
+59 −0 exercises/practice/roman-numerals/.docs/introduction.md
+1 −1 exercises/practice/roman-numerals/.meta/config.json
+18 −15 exercises/practice/roman-numerals/.meta/tests.toml
+23 −23 exercises/practice/roman-numerals/test/roman_numerals_test.exs
+0 −2 exercises/practice/say/.docs/instructions.md
+16 −31 exercises/practice/scrabble-score/.docs/instructions.md
+7 −0 exercises/practice/scrabble-score/.docs/introduction.md
+27 −13 exercises/practice/sieve/.docs/instructions.md
+1 −1 exercises/practice/spiral-matrix/.docs/instructions.md
+11 −0 exercises/practice/spiral-matrix/.docs/introduction.md
+1 −1 exercises/practice/strain/.meta/config.json
+1 −1 exercises/practice/two-bucket/.docs/instructions.md
+2 −3 exercises/practice/two-fer/.docs/instructions.md
+1 −1 exercises/practice/two-fer/.docs/introduction.md
+8 −13 exercises/practice/yacht/.docs/instructions.md
+11 −0 exercises/practice/yacht/.docs/introduction.md
+12 −4 exercises/practice/zebra-puzzle/.docs/instructions.md
+15 −0 exercises/practice/zebra-puzzle/.docs/introduction.md
+2 −1 mix.exs
+1 −0 mix.lock
2 changes: 1 addition & 1 deletion lib/elixir_analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ defmodule ElixirAnalyzer do
|> Submission.set_halt_reason("Analysis skipped, not able to decode solution config.")

e ->
Logger.warning("TestSuite halted, #{e.__struct__}", error_message: e.message)
Logger.warning("TestSuite halted, #{e.__struct__}", error_message: Exception.message(e))

submission
|> Submission.halt()
Expand Down
8 changes: 1 addition & 7 deletions lib/elixir_analyzer/exercise_test/feature/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@ defmodule ElixirAnalyzer.ExerciseTest.Feature.Compiler do
found =
params
|> Enum.chunk_every(unquote(block_params), 1, :discard)
|> Enum.reduce(false, fn
chunk, false ->
Compiler.form_match?(unquote(find_ast), chunk)

_chunk, true ->
true
end)
|> Enum.any?(&Compiler.form_match?(unquote(find_ast), &1))

{node, found}
else
Expand Down
12 changes: 6 additions & 6 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"certifi": {:hex, :certifi, "2.8.0", "d4fb0a6bb20b7c9c3643e22507e42f356ac090a1dcea9ab99e27e0376d695eba", [:rebar3], [], "hexpm", "6ac7efc1c6f8600b08d625292d4bbf584e14847ce1b6b5c44d983d273e1097ea"},
"credo": {:hex, :credo, "1.6.1", "7dc76dcdb764a4316c1596804c48eada9fff44bd4b733a91ccbf0c0f368be61e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "698607fb5993720c7e93d2d8e76f2175bba024de964e160e2f7151ef3ab82ac5"},
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
"credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"},
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"excoveralls": {:hex, :excoveralls, "0.14.4", "295498f1ae47bdc6dce59af9a585c381e1aefc63298d48172efaaa90c3d251db", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e3ab02f2df4c1c7a519728a6f0a747e71d7d6e846020aae338173619217931c1"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"excoveralls": {:hex, :excoveralls, "0.18.1", "a6f547570c6b24ec13f122a5634833a063aec49218f6fff27de9df693a15588c", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d65f79db146bb20399f23046015974de0079668b9abb2f5aac074d078da60b8d"},
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
"hackney": {:hex, :hackney, "1.18.0", "c4443d960bb9fba6d01161d01cd81173089686717d9490e5d3606644c48d121f", [:rebar3], [{:certifi, "~>2.8.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "9afcda620704d720db8c6a3123e9848d09c87586dc1c10479c42627b905b5c5e"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ defmodule ElixirAnalyzer.ExerciseTest.AssertCall.KernelTest do
[
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
Kernel.dbg()
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
dbg()
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
&Kernel.dbg/0
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
&dbg/0
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# credo:disable-for-this-file Credo.Check.Readability.PredicateFunctionNames
defmodule ElixirAnalyzer.ExerciseTest.CommonChecks.BooleanFunctionsTest do
use ExUnit.Case
alias ElixirAnalyzer.Comment
Expand Down
2 changes: 2 additions & 0 deletions test/elixir_analyzer/exercise_test/common_checks_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# credo:disable-for-this-file Credo.Check.Readability.VariableNames
# credo:disable-for-this-file Credo.Check.Readability.ModuleNames
# credo:disable-for-this-file Credo.Check.Warning.IoInspect
# credo:disable-for-this-file Credo.Check.Readability.PredicateFunctionNames

defmodule ElixirAnalyzer.ExerciseTestTest.Empty do
use ElixirAnalyzer.ExerciseTest
Expand Down Expand Up @@ -273,6 +274,7 @@ defmodule ElixirAnalyzer.ExerciseTest.CommonChecksTest do
defmodule MyModule do
def foo() do
(1 + 1)
# credo:disable-for-next-line Credo.Check.Warning.Dbg
|> dbg()
end
end,
Expand Down

0 comments on commit f3e6767

Please sign in to comment.