chore: format & credo

This commit is contained in:
Zach Daniel 2024-03-29 18:22:57 -04:00
parent f17d117b28
commit 8bec910e5e
3 changed files with 4 additions and 4 deletions

View file

@ -10,6 +10,5 @@ defmodule AshStateMachine.Errors.InvalidInitialState do
""" """
Attempted to set initial state to `:#{error.target}` in action `:#{error.action}`, but it is not a valid initial state. Attempted to set initial state to `:#{error.target}` in action `:#{error.action}`, but it is not a valid initial state.
""" """
end end
end end

View file

@ -83,14 +83,14 @@ defmodule Mix.Tasks.AshStateMachine.GenerateFlowCharts do
end end
end end
defp is_state_machine?(module) do defp state_machine?(module) do
Spark.Dsl.is?(module, Ash.Resource) and AshStateMachine in Spark.extensions(module) Spark.Dsl.is?(module, Ash.Resource) and AshStateMachine in Spark.extensions(module)
end end
defp state_machines do defp state_machines do
for module <- modules(), for module <- modules(),
{:module, module} = Code.ensure_compiled(module), {:module, module} = Code.ensure_compiled(module),
is_state_machine?(module) do state_machine?(module) do
module module
end end
end end

View file

@ -66,7 +66,8 @@ defmodule AshStateMachineTest do
changes do changes do
# any failures should be captured and transitioned to the error state # any failures should be captured and transitioned to the error state
change after_transaction(fn changeset, {:ok, result}, _ -> change after_transaction(fn
changeset, {:ok, result}, _ ->
{:ok, result} {:ok, result}
changeset, {:error, error}, _ -> changeset, {:error, error}, _ ->