chore: fix dev-env --warnings-as-errors failure in hardcover_provider #65

Merged
jfro merged 1 commit from jtk/hardcover-dev-warning into main 2026-10-18 22:40:10 +00:00
Owner

On Elixir 1.20, MIX_ENV=dev mix compile --force --warnings-as-errors failed: the type checker saw format_book_series(nil) as unreachable because the only caller defaulted book_data["book_series"] to [] (the nil clause was only reached via the test-only __format_series__/1).

Drop the || [] default so nil goes to the existing nil clause. Same result either way (nil and [] both give a nil series); dev compile with --warnings-as-errors now passes, and the existing __format_series__ tests cover both.

Fixes #62

On Elixir 1.20, `MIX_ENV=dev mix compile --force --warnings-as-errors` failed: the type checker saw `format_book_series(nil)` as unreachable because the only caller defaulted `book_data["book_series"]` to `[]` (the nil clause was only reached via the test-only `__format_series__/1`). Drop the `|| []` default so nil goes to the existing nil clause. Same result either way (nil and [] both give a nil series); dev compile with --warnings-as-errors now passes, and the existing `__format_series__` tests cover both. Fixes #62
jfro added this to the 0.6.2 milestone 2026-10-18 22:00:46 +00:00
chore: fix dev-env --warnings-as-errors failure in hardcover_provider
All checks were successful
CI / test (pull_request) Successful in 1m45s
1ba81dddbc
Author
Owner

Review from Nye (approved) — 1ba81dd

Without || [], nil goes to format_book_series(nil) and gives the same nil result. A non-list value crashed before and still does, so behavior is unchanged. This clears the Elixir 1.20 dev warnings-as-errors failure.

Review from Nye (approved) — 1ba81dd Without `|| []`, nil goes to `format_book_series(nil)` and gives the same nil result. A non-list value crashed before and still does, so behavior is unchanged. This clears the Elixir 1.20 dev warnings-as-errors failure.
jfro merged commit 4ca185e593 into main 2026-10-18 22:40:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/fuzzy_catalog!65
No description provided.