Skip to content

Commit 2b248b1

Browse files
Run on Elixir 1.15 and Erlang 26 (#386)
Co-authored-by: Angelika Tyborska <angelikatyborska@fastmail.com>
1 parent 03cec70 commit 2b248b1

18 files changed

Lines changed: 80 additions & 58 deletions

File tree

.github/workflows/elixir_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88

99
container:
10-
image: hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801
10+
image: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bookworm-20230612
1111

1212
steps:
1313
- name: Install git
@@ -53,7 +53,7 @@ jobs:
5353
id: plt-cache
5454
with:
5555
path: priv/plts
56-
key: elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-v3
56+
key: elixir:1.15.2-erlang-26.0.2-debian-bookworm-20230612-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-v3
5757

5858
- name: Create PLTs
5959
if: steps.plt-cache.outputs.cache-hit != 'true'

.github/workflows/elixir_test_external.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88

99
container:
10-
image: hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801
10+
image: hexpm/elixir:1.15.2-erlang-26.0.2-debian-bookworm-20230612
1111

1212
steps:
1313
- name: Install git

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
elixir 1.14.0-otp-25
2-
erlang 25.0.4
1+
elixir 1.15.2-otp-26
2+
erlang 26.0.2

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801 as builder
1+
FROM hexpm/elixir:1.15.2-erlang-26.0.2-debian-bookworm-20230612 as builder
22

33
RUN apt-get update && \
44
apt-get install bash -y
@@ -13,7 +13,7 @@ COPY . .
1313
# Builds an escript bin/elixir_analyzer
1414
RUN ./bin/build.sh
1515

16-
FROM hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801
16+
FROM hexpm/elixir:1.15.2-erlang-26.0.2-debian-bookworm-20230612
1717
COPY --from=builder /etc/passwd /etc/passwd
1818

1919
COPY --from=builder /elixir-analyzer/bin /opt/analyzer/bin

config/test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import Config
22

3-
config :logger, level: :warn
3+
config :logger, level: :warning

elixir

Submodule elixir updated 32 files

lib/elixir_analyzer/exercise_test.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ defmodule ElixirAnalyzer.ExerciseTest do
3535
feature_test_data = Module.get_attribute(env.module, :feature_tests)
3636
assert_call_data = Module.get_attribute(env.module, :assert_call_tests)
3737
check_source_data = Module.get_attribute(env.module, :check_source_tests)
38-
suppress_tests = Module.get_attribute(env.module, :suppress_tests, [])
38+
suppress_tests = Module.get_attribute(env.module, :suppress_tests) || []
3939

4040
# placeholders for submission code
4141
code_ast = quote do: code_ast

lib/elixir_analyzer/exercise_test/common_checks/compiler_warnings.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defmodule ElixirAnalyzer.ExerciseTest.CommonChecks.CompilerWarnings do
2424
[]
2525
end
2626

27-
Logger.configure(level: :warn)
27+
Logger.configure(level: :warning)
2828

2929
Application.put_env(:elixir, :ansi_enabled, true)
3030

lib/elixir_analyzer/test_suite/german_sysadmin.ex

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ defmodule ElixirAnalyzer.TestSuite.GermanSysadmin do
2525
comment Constants.german_sysadmin_no_string()
2626
end
2727

28-
assert_no_call "doesn't create binaries from character codes" do
29-
type :essential
30-
called_fn name: :<<>>
31-
comment Constants.german_sysadmin_no_string()
32-
end
33-
3428
assert_call "using case is required" do
3529
type :essential
3630
called_fn name: :case
@@ -46,4 +40,32 @@ defmodule ElixirAnalyzer.TestSuite.GermanSysadmin do
4640
Enum.all?(integers, &String.contains?(code_string, &1))
4741
end
4842
end
43+
44+
check_source "doesn't create binaries from character codes" do
45+
type :essential
46+
comment Constants.german_sysadmin_no_string()
47+
48+
check(%Source{code_ast: code_ast}) do
49+
{_, no_binary?} =
50+
code_ast
51+
|> Macro.postwalk(&remove_sigil_c/1)
52+
|> Macro.postwalk(true, &no_binary_fun?/2)
53+
54+
no_binary?
55+
end
56+
end
57+
58+
defp remove_sigil_c({:sigil_c, _, _}) do
59+
[]
60+
end
61+
62+
defp remove_sigil_c(node), do: node
63+
64+
defp no_binary_fun?({:<<>>, _, _} = node, _) do
65+
{node, false}
66+
end
67+
68+
defp no_binary_fun?(node, acc) do
69+
{node, acc}
70+
end
4971
end

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule ElixirAnalyzer.MixProject do
55
[
66
app: :elixir_analyzer,
77
version: "0.1.0",
8-
elixir: "~> 1.14",
8+
elixir: "~> 1.15",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
start_permanent: Mix.env() == :prod,
1111
# Turn off protocol consolidation to avoid warning in analyzed code

0 commit comments

Comments
 (0)