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:
@@ -10,14 +10,12 @@ defmodule SimpleshopThemeWeb.CheckoutController do
|
||||
cart_items = Cart.get_from_session(get_session(conn))
|
||||
hydrated = Cart.hydrate(cart_items)
|
||||
|
||||
cond do
|
||||
hydrated == [] ->
|
||||
conn
|
||||
|> put_flash(:error, "Your basket is empty")
|
||||
|> redirect(to: ~p"/cart")
|
||||
|
||||
true ->
|
||||
create_checkout(conn, hydrated)
|
||||
if hydrated == [] do
|
||||
conn
|
||||
|> put_flash(:error, "Your basket is empty")
|
||||
|> redirect(to: ~p"/cart")
|
||||
else
|
||||
create_checkout(conn, hydrated)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user