Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dialyzer warnings and remove ignore file #952

Merged
merged 5 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading