From 6b5d0d598e15a625bcb3e30caf1ace3ebf73394a Mon Sep 17 00:00:00 2001 From: Christoph Grothaus Date: Thu, 4 Jan 2024 11:04:16 +0100 Subject: [PATCH] Support Elixir 1.16 in call to `Code.string_to_quoted/2` 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`. --- lib/mix_audit/project.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mix_audit/project.ex b/lib/mix_audit/project.ex index 1995206..fd37f1a 100644 --- a/lib/mix_audit/project.ex +++ b/lib/mix_audit/project.ex @@ -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),