commit: a2664927762f9e34146830cc83940a4db2b071d2
parent 2de84e2e3beb5fe74760a3af083109eed00262f0
Author: Mark Felder <feld@feld.me>
Date: Mon, 29 Jan 2024 17:37:52 -0500
Pleroma.User: dialyzer errors
lib/pleroma/user.ex:757:no_return
Function register_changeset/1 has no local return.
________________________________________________________________________________
lib/pleroma/user.ex:757:no_return
Function register_changeset/2 has no local return.
________________________________________________________________________________
lib/pleroma/user.ex:757:no_return
Function register_changeset/3 has no local return.
________________________________________________________________________________
lib/pleroma/user.ex:778:call
The function call will not succeed.
Pleroma.User.approval_changeset(
%Ecto.Changeset{
:action => atom(),
:changes => %{atom() => _},
:constraints => [
%{
:constraint =>
binary()
| %Regex{
:opts => binary() | [any()],
:re_pattern => _,
:re_version => _,
:source => binary()
},
:error_message => binary(),
:error_type => atom(),
:field => atom(),
:match => :exact | :prefix | :suffix,
:type => :check | :exclusion | :foreign_key | :unique
}
],
:data => nil | map(),
:empty_values => _,
:errors => Keyword.t({binary(), Keyword.t()}),
:filters => %{atom() => _},
:params => nil | %{binary() => _},
:prepare => [(_ -> any())],
:repo => atom(),
:repo_opts => Keyword.t(),
:required => [atom()],
:types =>
nil
| %{
atom() =>
atom()
| {:array | :assoc | :embed | :in | :map | :maybe | :param, _}
| {:parameterized, atom(), _}
},
:valid? => boolean(),
:validations => Keyword.t()
},
[{:set_approval, _}, ...]
)
breaks the contract
(t(), :elixir.keyword()) :: Ecto.Changeset.t()
________________________________________________________________________________
lib/pleroma/user.ex:854:unused_fun
Function maybe_validate_required_birthday/1 will never be called.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
@@ -2559,9 +2559,9 @@ defmodule Pleroma.User do
cast(user, params, [:is_confirmed, :confirmation_token])
end
- @spec approval_changeset(User.t(), keyword()) :: Ecto.Changeset.t()
- def approval_changeset(user, set_approval: approved?) do
- cast(user, %{is_approved: approved?}, [:is_approved])
+ @spec approval_changeset(Ecto.Changeset.t(), keyword()) :: Ecto.Changeset.t()
+ def approval_changeset(changeset, set_approval: approved?) do
+ cast(changeset, %{is_approved: approved?}, [:is_approved])
end
@spec add_pinned_object_id(User.t(), String.t()) :: {:ok, User.t()} | {:error, term()}