Add Credo refactor checks and fix double Enum.map

Add 9 enabled + 1 disabled Credo checks from ex_slop README.
Fix MapMap finding in ListeningStats.update/1 (single pass).
Disable AppendSingleItem (10 pre-existing violations).
This commit is contained in:
Claudio Ortolina
2026-05-14 10:47:13 +01:00
parent 1f7d552727
commit d30e6d2d8f
2 changed files with 13 additions and 3 deletions
+1 -2
View File
@@ -51,8 +51,7 @@ defmodule MusicLibrary.ListeningStats do
def update(tracks) do
track_params =
tracks
|> Enum.map(fn t -> Map.take(t, @insertable_fields) end)
|> Enum.map(&Map.to_list/1)
|> Enum.map(fn t -> t |> Map.take(@insertable_fields) |> Map.to_list() end)
{count, tracks} =
Repo.insert_all(Track, track_params,