From 7e71df8a966f74310a5b9852639461451757d79c Mon Sep 17 00:00:00 2001 From: Nikos Papadakis Date: Tue, 29 Aug 2023 14:16:25 +0300 Subject: [PATCH] app: fix dialyixir (closes #4) --- app/lib/prymn/accounts/user.ex | 8 ++++---- app/lib/prymn/accounts/user_notifier.ex | 9 ++++++--- app/mix.exs | 2 +- app/mix.lock | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/lib/prymn/accounts/user.ex b/app/lib/prymn/accounts/user.ex index bb13972..3df06b1 100644 --- a/app/lib/prymn/accounts/user.ex +++ b/app/lib/prymn/accounts/user.ex @@ -5,10 +5,10 @@ defmodule Prymn.Accounts.User do @type t :: %__MODULE__{ id: term, - email: String.t(), - password: String.t(), - hashed_password: String.t(), - confirmed_at: NaiveDateTime.t() + email: String.t() | nil, + password: String.t() | nil, + hashed_password: String.t() | nil, + confirmed_at: NaiveDateTime.t() | nil } schema "users" do diff --git a/app/lib/prymn/accounts/user_notifier.ex b/app/lib/prymn/accounts/user_notifier.ex index 7753077..75428aa 100644 --- a/app/lib/prymn/accounts/user_notifier.ex +++ b/app/lib/prymn/accounts/user_notifier.ex @@ -19,7 +19,8 @@ defmodule Prymn.Accounts.UserNotifier do @doc """ Deliver instructions to confirm account. """ - @spec deliver_confirmation_instructions(User.t(), String.t()) :: {:ok, Swoosh.Email.t()} + @spec deliver_confirmation_instructions(Prymn.Accounts.User.t(), String.t()) :: + {:ok, Swoosh.Email.t()} def deliver_confirmation_instructions(user, url) do deliver(user.email, "Confirmation instructions", """ @@ -40,7 +41,8 @@ defmodule Prymn.Accounts.UserNotifier do @doc """ Deliver instructions to reset a user password. """ - @spec deliver_reset_password_instructions(User.t(), String.t()) :: {:ok, Swoosh.Email.t()} + @spec deliver_reset_password_instructions(Prymn.Accounts.User.t(), String.t()) :: + {:ok, Swoosh.Email.t()} def deliver_reset_password_instructions(user, url) do deliver(user.email, "Reset password instructions", """ @@ -61,7 +63,8 @@ defmodule Prymn.Accounts.UserNotifier do @doc """ Deliver instructions to update a user email. """ - @spec deliver_update_email_instructions(User.t(), String.t()) :: {:ok, Swoosh.Email.t()} + @spec deliver_update_email_instructions(Prymn.Accounts.User.t(), String.t()) :: + {:ok, Swoosh.Email.t()} def deliver_update_email_instructions(user, url) do deliver(user.email, "Update email instructions", """ diff --git a/app/mix.exs b/app/mix.exs index d8d4ed7..0f11efa 100644 --- a/app/mix.exs +++ b/app/mix.exs @@ -60,7 +60,7 @@ defmodule Prymn.MixProject do {:tailwind, "~> 0.2.0", runtime: Mix.env() == :dev}, {:tailwind_formatter, "~> 0.3.6", runtime: Mix.env() == :dev}, {:phoenix_live_reload, "~> 1.2", only: :dev}, - {:dialyxir, "~> 1.3", only: [:dev], runtime: false}, + {:dialyxir, "~> 1.4", only: [:dev], runtime: false}, {:prymn_proto_compiler, path: "../proto_compiler", runtime: false} ] end diff --git a/app/mix.lock b/app/mix.lock index 1eede72..6f7e214 100644 --- a/app/mix.lock +++ b/app/mix.lock @@ -7,7 +7,7 @@ "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, "db_connection": {:hex, :db_connection, "2.5.0", "bb6d4f30d35ded97b29fe80d8bd6f928a1912ca1ff110831edcd238a1973652c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c92d5ba26cd69ead1ff7582dbb860adeedfff39774105a4f1c92cbb654b55aa2"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, - "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, + "dialyxir": {:hex, :dialyxir, "1.4.0", "6b698401c16de79e8596b73dca63762255e70e4bbe26423530e173917220d5fc", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "c7ecaa1da27debae488ab09d9827ec58a0161c7821972b6d2cb26c1614648849"}, "ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"}, "ecto_sql": {:hex, :ecto_sql, "3.10.1", "6ea6b3036a0b0ca94c2a02613fd9f742614b5cfe494c41af2e6571bb034dd94c", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.10.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16.0 or ~> 0.17.0 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6a25bdbbd695f12c8171eaff0851fa4c8e72eec1e98c7364402dda9ce11c56b"}, "elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},