Skip to content

Commit

Permalink
Merge pull request #952 from appsignal/dialyzer-fixes
Browse files Browse the repository at this point in the history
Fix Dialyzer warnings and remove ignore file
  • Loading branch information
jeffkreeftmeijer authored Jun 26, 2024
2 parents 2c13e8f + fefa3c2 commit a7ffd4e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 0 additions & 6 deletions dialyzer.ignore-warnings

This file was deleted.

14 changes: 13 additions & 1 deletion lib/mix/tasks/appsignal.install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ defmodule Mix.Tasks.Appsignal.Install do

case File.open(appsignal_config_file_path(), [:write]) do
{:ok, file} ->
case IO.binwrite(file, appsignal_config_file_contents(config)) do
case binwrite_with_result(file, appsignal_config_file_contents(config)) do
:ok ->
IO.puts("Success!")

Expand All @@ -200,6 +200,18 @@ defmodule Mix.Tasks.Appsignal.Install do
end
end

if Version.match?(System.version(), ">= 1.16.0") do
defp binwrite_with_result(path, contents) do
try do
IO.binwrite(path, contents)
catch
{:error, reason} -> {:error, reason}
end
end
else
defdelegate binwrite_with_result(path, contents), to: IO, as: :binwrite
end

# Link the config/appsignal.exs config file to the config/config.exs file.
# If already linked, it's ignored.
defp link_config_file do
Expand Down
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ defmodule Appsignal.Mixfile do
extras: ["README.md", "CHANGELOG.md"]
],
dialyzer: [
ignore_warnings: "dialyzer.ignore-warnings",
plt_file: {:no_warn, "priv/plts/dialyzer.plt"},
plt_add_apps: [:mix]
]
Expand Down

0 comments on commit a7ffd4e

Please sign in to comment.