diff --git a/.github/workflows/elixir_test.yml b/.github/workflows/elixir_test.yml index 5013e525..1e1b2e82 100644 --- a/.github/workflows/elixir_test.yml +++ b/.github/workflows/elixir_test.yml @@ -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 @@ -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' @@ -73,4 +73,3 @@ jobs: - name: Run Smoke Test in Docker run: bin/run-tests-in-docker.sh - diff --git a/.github/workflows/elixir_test_external.yml b/.github/workflows/elixir_test_external.yml index bace1e0a..291e480c 100644 --- a/.github/workflows/elixir_test_external.yml +++ b/.github/workflows/elixir_test_external.yml @@ -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 diff --git a/.tool-versions b/.tool-versions index 000a611a..f8bb424b 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.16.0-otp-26 -erlang 26.2.1 +elixir 1.17.0-otp-27 +erlang 27.0 diff --git a/Dockerfile b/Dockerfile index d181f649..019cbf72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 diff --git a/config/config.exs b/config/config.exs index b7137954..3cbc3c08 100644 --- a/config/config.exs +++ b/config/config.exs @@ -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 diff --git a/elixir b/elixir index f387a440..6b6bc5b6 160000 --- a/elixir +++ b/elixir @@ -1 +1 @@ -Subproject commit f387a4405e63ea89fb876adbb0b79aee0955734e +Subproject commit 6b6bc5b6d3ca3463b7d2b15fbf33f4864e028508 diff --git a/lib/elixir_analyzer.ex b/lib/elixir_analyzer.ex index 52428b22..0e0f83f9 100644 --- a/lib/elixir_analyzer.ex +++ b/lib/elixir_analyzer.ex @@ -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() diff --git a/lib/elixir_analyzer/exercise_test/feature/compiler.ex b/lib/elixir_analyzer/exercise_test/feature/compiler.ex index ea2969c3..45457c61 100644 --- a/lib/elixir_analyzer/exercise_test/feature/compiler.ex +++ b/lib/elixir_analyzer/exercise_test/feature/compiler.ex @@ -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 diff --git a/mix.lock b/mix.lock index 36f85a2a..e83f3544 100644 --- a/mix.lock +++ b/mix.lock @@ -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"}, diff --git a/test/elixir_analyzer/exercise_test/assert_call/kernel_functions_test.exs b/test/elixir_analyzer/exercise_test/assert_call/kernel_functions_test.exs index 0e1528ca..581130ab 100644 --- a/test/elixir_analyzer/exercise_test/assert_call/kernel_functions_test.exs +++ b/test/elixir_analyzer/exercise_test/assert_call/kernel_functions_test.exs @@ -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 diff --git a/test/elixir_analyzer/exercise_test/common_checks/boolean_functions_test.exs b/test/elixir_analyzer/exercise_test/common_checks/boolean_functions_test.exs index 1514fa2b..496a61c1 100644 --- a/test/elixir_analyzer/exercise_test/common_checks/boolean_functions_test.exs +++ b/test/elixir_analyzer/exercise_test/common_checks/boolean_functions_test.exs @@ -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 diff --git a/test/elixir_analyzer/exercise_test/common_checks_test.exs b/test/elixir_analyzer/exercise_test/common_checks_test.exs index 87197383..abf423ad 100644 --- a/test/elixir_analyzer/exercise_test/common_checks_test.exs +++ b/test/elixir_analyzer/exercise_test/common_checks_test.exs @@ -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 @@ -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,