commit: c6f783c5519cc2cd519be4406366ecbad57a8c40
parent 3b9d991514e53ad8f442ffc674dd9b1422fdc415
Author: Mark Felder <feld@feld.me>
Date: Wed, 31 Jan 2024 11:01:37 -0500
Pleroma.Web.ControllerHelper: fix @spec to resolve dialyzer errors
lib/pleroma/web/admin_api/controllers/user_controller.ex:333:no_return
Function index/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:357:unused_fun
Function maybe_parse_filters/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:366:no_return
Function page_params/1 has no local return.
________________________________________________________________________________
lib/pleroma/web/admin_api/controllers/user_controller.ex:368:call
The function call will not succeed.
Pleroma.Web.ControllerHelper.fetch_integer_param(_params :: any(), :page, 1)
breaks the contract
(map(), String.t(), integer() | nil) :: integer() | nil
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pleroma/web/controller_helper.ex b/lib/pleroma/web/controller_helper.ex
@@ -20,7 +20,7 @@ defmodule Pleroma.Web.ControllerHelper do
|> json(json)
end
- @spec fetch_integer_param(map(), String.t(), integer() | nil) :: integer() | nil
+ @spec fetch_integer_param(map(), String.t() | atom(), integer() | nil) :: integer() | nil
def fetch_integer_param(params, name, default \\ nil) do
params
|> Map.get(name, default)