Skip to content

Commit

Permalink
Support Elixir 1.16 in call to Code.string_to_quoted/2
Browse files Browse the repository at this point in the history
Elixir 1.16 brought an API change to `Code.string_to_quoted/2`:
the option `warn_on_unnecessary_quotes` was removed and replaced
by `emit_warnings`.
  • Loading branch information
cgrothaus authored and remi committed Jan 8, 2024
1 parent d6523a6 commit 6b5d0d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mix_audit/project.ex
Expand Up @@ -16,7 +16,10 @@ defmodule MixAudit.Project do
end

defp read_lockfile(lockfile) do
opts = [file: lockfile, warn_on_unnecessary_quotes: false]
# Backwards compatibility: suppressing warnings needs to be done with two different options:
# - emit_warnings: from Elixir v1.16 onwards
# - warn_on_unnecessary_quotes: up to Elixir v1.15
opts = [file: lockfile, emit_warnings: false, warn_on_unnecessary_quotes: false]

with {:ok, contents} <- File.read(lockfile),
assert_no_merge_conflicts_in_lockfile(lockfile, contents),
Expand Down

0 comments on commit 6b5d0d5

Please sign in to comment.