add CI pipeline with credo and dialyzer
mix ci alias: compile --warning-as-errors, format --check-formatted, credo, dialyzer, test. Credo configured with sensible defaults. Dialyzer ignore file for false positives (Stripe types, Mix tasks, ExUnit internals). Credo fixes: map_join, filter consolidation, nesting extraction, cond→if simplification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -146,21 +146,22 @@ defmodule SimpleshopTheme.Providers.Printify do
|
||||
true ->
|
||||
with api_key when is_binary(api_key) <- ProviderConnection.get_api_key(conn),
|
||||
:ok <- set_api_key(api_key) do
|
||||
results =
|
||||
Enum.map(@webhook_events, fn event ->
|
||||
case Client.create_webhook(shop_id, webhook_url, event, secret) do
|
||||
{:ok, response} -> {:ok, event, response}
|
||||
{:error, reason} -> {:error, event, reason}
|
||||
end
|
||||
end)
|
||||
|
||||
{:ok, results}
|
||||
{:ok, create_all_webhooks(shop_id, webhook_url, secret)}
|
||||
else
|
||||
nil -> {:error, :no_api_key}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
defp create_all_webhooks(shop_id, webhook_url, secret) do
|
||||
Enum.map(@webhook_events, fn event ->
|
||||
case Client.create_webhook(shop_id, webhook_url, event, secret) do
|
||||
{:ok, response} -> {:ok, event, response}
|
||||
{:error, reason} -> {:error, event, reason}
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Lists registered webhooks for the shop.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user