From e7df2614bc82d71f4ce12693ec7cde3b15067e8d Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 17 Feb 2026 15:30:30 +0000 Subject: [PATCH] Enable Nesting credo check With two accepted exceptions --- .credo.exs | 4 +++- lib/mix/tasks/scrobble/audit.ex | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.credo.exs b/.credo.exs index bc4aee01..5ce2ec15 100644 --- a/.credo.exs +++ b/.credo.exs @@ -3,9 +3,11 @@ %{ name: "default", checks: %{ + extra: [ + {Credo.Check.Refactor.Nesting, max_nesting: 3} + ], disabled: [ {Credo.Check.Refactor.CyclomaticComplexity, []}, - {Credo.Check.Refactor.Nesting, []}, {Credo.Check.Readability.ModuleDoc, []} ] } diff --git a/lib/mix/tasks/scrobble/audit.ex b/lib/mix/tasks/scrobble/audit.ex index 7d154139..67d55587 100644 --- a/lib/mix/tasks/scrobble/audit.ex +++ b/lib/mix/tasks/scrobble/audit.ex @@ -307,6 +307,7 @@ defmodule Mix.Tasks.Scrobble.Audit do Enum.each(artist_issues.sample_tracks, fn %{artist: artist, sample_tracks: tracks} -> Mix.Shell.IO.info("\n Artist: #{artist}") + # credo:disable-for-next-line Credo.Check.Refactor.Nesting Enum.each(tracks, fn track -> Mix.Shell.IO.info(" - #{track.title} (from #{track.album})") end) @@ -343,6 +344,7 @@ defmodule Mix.Tasks.Scrobble.Audit do } -> Mix.Shell.IO.info("\n Album: #{album} by #{artist}") + # credo:disable-for-next-line Credo.Check.Refactor.Nesting Enum.each(tracks, fn track -> Mix.Shell.IO.info(" - #{track.title}") end)