Skip to content

Commit

Permalink
Upgrade to Elixir 1.15
Browse files Browse the repository at this point in the history
Inets need to be started in Elixir 1.15 due to code load changes.
  • Loading branch information
danschultzer committed Jul 10, 2023
1 parent 374807d commit 6b8caa2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
otp: 25.1
- elixir: '1.14.x'
otp: 25.1
- elixir: '1.15.x'
otp: 26.0

steps:
- name: Setup Elixir
Expand All @@ -54,11 +56,11 @@ jobs:
run: mix hex.audit

- name: Check Formatting
if: ${{ matrix.elixir == '1.14.x' }} # we only care about formatting for latest version of Elixir
if: ${{ matrix.elixir == '1.15.x' }} # we only care about formatting for latest version of Elixir
run: mix format --check-formatted

- name: Compiles w/o Warnings
if: ${{ matrix.elixir == '1.14.x' }} # we only care about warnings for latest version of Elixir
if: ${{ matrix.elixir == '1.15.x' }} # we only care about warnings for latest version of Elixir
run: mix compile --warnings-as-errors

- name: Credo
Expand Down
5 changes: 5 additions & 0 deletions lib/mix/tasks/sobelow.ex
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ defmodule Mix.Tasks.Sobelow do

save_config = Keyword.get(opts, :save_config)

if function_exported?(Mix, :ensure_application!, 1) do
Mix.ensure_application!(:ssl)
Mix.ensure_application!(:inets)
end

cond do
diff ->
run_diff(argv)
Expand Down
6 changes: 3 additions & 3 deletions test/log_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule SobelowTest.LogTest do

# log_json_finding(line_no, filename, fun_name, var, severity, type)
test "Log JSON finding with function as function name" do
output = """
output = Jason.decode!("""
{
"findings": {
"high_confidence": [
Expand All @@ -21,7 +21,7 @@ defmodule SobelowTest.LogTest do
"sobelow_version": "1.0.0",
"total_findings": 1
}
"""
""")

FindingLog.start_link()
Fingerprint.start_link()
Expand All @@ -35,6 +35,6 @@ defmodule SobelowTest.LogTest do

Sobelow.log_finding(finding, %Sobelow.Finding{confidence: :high})

assert FindingLog.json("1.0.0") <> "\n" == output
assert Jason.decode!(FindingLog.json("1.0.0")) == output
end
end

0 comments on commit 6b8caa2

Please sign in to comment.