Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix remaining actions typespecs #31

Merged

Conversation

CorneliaKelinske
Copy link
Contributor

Fix for those:

lib/actions.ex:216:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
EctoShorts.Actions.find_and_update/4

Success typing:
@spec find_and_update(Ecto.Query | Ecto.Schema, map(), _, Keyword.t()) :: {:error, _} | {:ok, %{atom() => _}}

lib/actions.ex:240:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
EctoShorts.Actions.find_and_upsert/4

Success typing:
@spec find_and_upsert(Ecto.Query | Ecto.Schema, map(), _, Keyword.t()) :: {:error, _} | {:ok, %{atom() => _}}
The function call will not succeed.

EctoShorts.Actions.delete(_schema_data :: maybe_improper_list(), [{:repo, _}, ...])

breaks the contract
Contract head:
(schema_data :: Ecto.Schema.t(), opts()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Contract head:
(schema :: Ecto.Schema.t(), id :: integer()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

in 1st argument

________________________________________________________________________________
lib/actions.ex:397:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
EctoShorts.Actions.delete/3

Success typing:
@spec delete(Ecto.Query | Ecto.Schema, binary() | integer(), Keyword.t()) :: any()

@MikaAK MikaAK merged commit bcd2a29 into MikaAK:main Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants