Fix credo style reports following it's update

Mainly transform `with` into `case`

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-07-23 18:06:22 +02:00
parent 1cd511f440
commit c3cca5d613
26 changed files with 303 additions and 248 deletions

View File

@@ -10,11 +10,15 @@ defmodule Mix.Tasks.Mobilizon.Toot do
def run([from, content]) do
Mix.Task.run("app.start")
with {:ok, _} <- MobilizonWeb.API.Comments.create_comment(from, content) do
Mix.shell().info("Tooted")
else
{:local_actor, _} -> Mix.shell().error("Failed to toot.\nActor #{from} doesn't exist")
_ -> Mix.shell().error("Failed to toot.")
case MobilizonWeb.API.Comments.create_comment(from, content) do
{:ok, _} ->
Mix.shell().info("Tooted")
{:local_actor, _} ->
Mix.shell().error("Failed to toot.\nActor #{from} doesn't exist")
_ ->
Mix.shell().error("Failed to toot.")
end
end
end