add static analysis tool Dialyzer

This commit is contained in:
Owen
2024-12-16 22:42:30 +01:00
parent cfdc5018c2
commit b85d9350a5
4 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
attachment_urls = get_attachment_urls(interaction)
original_images = get_original_images(attachment_urls)
# FUNCTION return image filename list as a list of images to delete
# FUNCTION return image filename list as a list of images to delete
saved_images =
try do
File.download_and_save_files!(attachment_urls)
@@ -99,7 +99,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
})
end
# TODO delete saved images
# TODO delete saved images, make into a task
end
defp get_attachment_urls(interaction) do
+3 -2
View File
@@ -56,8 +56,9 @@ defmodule PlantIdDiscordBot.FileServer.File do
|> File.read()
end
@spec delete_file!(String.t()) :: :ok
def delete_file!(filename) do
# TODO make into a task for async deletion
@spec delete_files!([String.t()]) :: :ok
def delete_files!(filename) do
File.rm!(Path.join(@image_path, filename))
end