refactor(types): reconcile @specs with their success typings
This commit is contained in:
parent
263857ee26
commit
fd8e6ac178
17 changed files with 92 additions and 38 deletions
|
|
@ -409,7 +409,7 @@ defmodule Mv.Config do
|
|||
@doc """
|
||||
Returns the OIDC groups claim name (default "groups"). ENV first, then Settings.
|
||||
"""
|
||||
@spec oidc_groups_claim() :: String.t() | nil
|
||||
@spec oidc_groups_claim() :: String.t()
|
||||
def oidc_groups_claim do
|
||||
case env_or_setting("OIDC_GROUPS_CLAIM", :oidc_groups_claim) do
|
||||
nil -> "groups"
|
||||
|
|
@ -492,7 +492,7 @@ defmodule Mv.Config do
|
|||
- ENV-only mode (`SMTP_HOST` set): read from ENV `SMTP_PORT`
|
||||
- Settings mode: read from Settings only
|
||||
"""
|
||||
@spec smtp_port() :: non_neg_integer() | nil
|
||||
@spec smtp_port() :: pos_integer() | nil
|
||||
def smtp_port do
|
||||
if smtp_env_mode?() do
|
||||
parse_smtp_port_env(System.get_env("SMTP_PORT"))
|
||||
|
|
@ -638,9 +638,15 @@ defmodule Mv.Config do
|
|||
"""
|
||||
@spec mail_from_name() :: String.t()
|
||||
def mail_from_name do
|
||||
case System.get_env("MAIL_FROM_NAME") do
|
||||
nil -> get_from_settings(:smtp_from_name) || "Mila"
|
||||
value -> trim_nil(value) || "Mila"
|
||||
name =
|
||||
case System.get_env("MAIL_FROM_NAME") do
|
||||
nil -> get_from_settings(:smtp_from_name)
|
||||
value -> trim_nil(value)
|
||||
end
|
||||
|
||||
case name do
|
||||
nil -> "Mila"
|
||||
name -> name
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue