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:
jamey
2026-02-08 15:19:42 +00:00
parent 518da36c8f
commit eaa4bbb3fa
16 changed files with 328 additions and 59 deletions

View File

@@ -128,9 +128,7 @@ defmodule SimpleshopTheme.Theme.Fonts do
[heading_key, body_key]
end
font_keys
|> Enum.map(&generate_font_face_for_font(&1, path_resolver))
|> Enum.join("\n")
Enum.map_join(font_keys, "\n", &generate_font_face_for_font(&1, path_resolver))
end
@doc """
@@ -143,8 +141,7 @@ defmodule SimpleshopTheme.Theme.Fonts do
def generate_all_font_faces(path_resolver \\ &default_path_resolver/1) do
@fonts
|> Map.keys()
|> Enum.map(&generate_font_face_for_font(&1, path_resolver))
|> Enum.join("\n")
|> Enum.map_join("\n", &generate_font_face_for_font(&1, path_resolver))
end
@doc """
@@ -213,8 +210,7 @@ defmodule SimpleshopTheme.Theme.Fonts do
defp generate_font_face_for_font(key, path_resolver) do
case get_font(key) do
%{family: family, file_prefix: prefix, weights: weights} ->
weights
|> Enum.map(fn weight ->
Enum.map_join(weights, "", fn weight ->
weight_suffix = if weight == 400, do: "regular", else: to_string(weight)
font_path = path_resolver.("/fonts/#{prefix}-#{weight_suffix}.woff2")
@@ -228,7 +224,6 @@ defmodule SimpleshopTheme.Theme.Fonts do
}
"""
end)
|> Enum.join("")
nil ->
""

View File

@@ -393,8 +393,7 @@ defmodule SimpleshopTheme.Theme.PreviewData do
# Get available variants for pricing
available_variants =
product.variants
|> Enum.filter(& &1.is_enabled)
|> Enum.filter(& &1.is_available)
|> Enum.filter(&(&1.is_enabled and &1.is_available))
# Get the cheapest available variant for display price
cheapest_variant =