From 34f4a434761129e1209013472fdad755111e3b15 Mon Sep 17 00:00:00 2001 From: Dominic Rubas <1042243+rubas@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:49:45 +0200 Subject: [PATCH 1/2] chore: enable the recommended ex_slop checks from ExSlop.recommended_checks/0 --- .credo.exs | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/.credo.exs b/.credo.exs index 5c62e0e..3a56ab9 100644 --- a/.credo.exs +++ b/.credo.exs @@ -135,41 +135,12 @@ # ## ExDNA - AST-based duplication detection (replaces DuplicatedCode) # - {ExDNA.Credo, []}, + {ExDNA.Credo, []} # - ## ExSlop - catch AI-generated code slop + ## ExSlop - the recommended AI slop checks of the installed version # - {ExSlop.Check.Warning.BlanketRescue, []}, - {ExSlop.Check.Warning.RescueWithoutReraise, []}, - {ExSlop.Check.Warning.RepoAllThenFilter, []}, - {ExSlop.Check.Warning.QueryInEnumMap, []}, - {ExSlop.Check.Warning.GenserverAsKvStore, []}, - {ExSlop.Check.Warning.PathExpandPriv, []}, - {ExSlop.Check.Warning.DualKeyAccess, []}, - {ExSlop.Check.Refactor.FilterNil, []}, - {ExSlop.Check.Refactor.RejectNil, []}, - {ExSlop.Check.Refactor.ReduceAsMap, []}, - {ExSlop.Check.Refactor.MapIntoLiteral, []}, - {ExSlop.Check.Refactor.IdentityPassthrough, []}, - {ExSlop.Check.Refactor.IdentityMap, []}, - {ExSlop.Check.Refactor.TryRescueWithSafeAlternative, []}, - {ExSlop.Check.Refactor.WithIdentityElse, []}, - {ExSlop.Check.Refactor.WithIdentityDo, []}, - {ExSlop.Check.Refactor.SortThenReverse, []}, - {ExSlop.Check.Refactor.StringConcatInReduce, []}, - {ExSlop.Check.Refactor.ReduceMapPut, []}, - {ExSlop.Check.Refactor.RedundantBooleanIf, []}, - {ExSlop.Check.Refactor.FlatMapFilter, []}, - {ExSlop.Check.Readability.NarratorDoc, []}, - {ExSlop.Check.Readability.BoilerplateDocParams, []}, - {ExSlop.Check.Readability.NarratorComment, []}, - {ExSlop.Check.Refactor.RedundantEnumJoinSeparator, []}, - {ExSlop.Check.Refactor.GraphemesLength, []}, - {ExSlop.Check.Refactor.ManualStringReverse, []}, - {ExSlop.Check.Refactor.SortThenAt, []}, - {ExSlop.Check.Refactor.SortForTopK, []}, - {ExSlop.Check.Refactor.ExplicitSumReduce, []} + | Enum.map(ExSlop.recommended_checks(), &{&1, []}) ], disabled: [ {Credo.Check.Design.DuplicatedCode, []}, From ddb1ba8723d279de2a1600a24a7d5293023f20de Mon Sep 17 00:00:00 2001 From: Dominic Rubas <1042243+rubas@users.noreply.github.com> Date: Wed, 23 Sep 2026 15:49:45 +0200 Subject: [PATCH 2/2] test: count packets without comparing length/1 to a literal --- test/integration_test.exs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration_test.exs b/test/integration_test.exs index b840824..ecb7515 100644 --- a/test/integration_test.exs +++ b/test/integration_test.exs @@ -310,7 +310,7 @@ defmodule Exmpeg.IntegrationTest do # in the packet timestamps below where the container duration alone hides # them. pts = video_packet_pts_times(out) - assert length(pts) >= 36 and length(pts) <= 44 + assert Enum.count_until(pts, 45) in 36..44 assert Enum.max(pts) > 3.5 gaps = pts |> Enum.chunk_every(2, 1, :discard) |> Enum.map(fn [a, b] -> b - a end) @@ -687,7 +687,7 @@ defmodule Exmpeg.IntegrationTest do src_pts = video_packet_pts_times(vfr) out_pts = video_packet_pts_times(cropped) - assert length(src_pts) == 20 and length(out_pts) == 20 + assert length(out_pts) == length(src_pts) assert_in_delta List.last(src_pts), 1.85, 0.002 Enum.zip_with(src_pts, out_pts, &assert_in_delta(&1, &2, 0.002)) end @@ -708,7 +708,7 @@ defmodule Exmpeg.IntegrationTest do ) src_pts = video_packet_pts_times(src) - assert length(src_pts) == 20 + assert src_pts == src_pts |> Enum.dedup() |> Enum.flat_map(&[&1, &1]) assert {:ok, _} = Exmpeg.transcode(src, out, video_codec: "libx264", video_filter: "crop=iw:ih-8:0:4") assert video_packet_pts_times(out) == Enum.dedup(src_pts) @@ -731,7 +731,7 @@ defmodule Exmpeg.IntegrationTest do for {out, opts} <- Enum.zip(outs, [[], [video_filter: "null"]]) do assert {:ok, _} = Exmpeg.transcode(src, out, [video_codec: "libx264"] ++ opts) pts = video_packet_pts_times(out) - assert length(pts) == 20 + assert Enum.count_until(pts, 21) == 20 assert_in_delta List.last(pts), 1.9, 0.01 end end @@ -751,7 +751,7 @@ defmodule Exmpeg.IntegrationTest do assert {:ok, _} = Exmpeg.transcode(src, out, video_codec: "libx264") pts = video_packet_pts_times(out) - assert length(pts) == 20 + assert Enum.count_until(pts, 21) == 20 assert_in_delta List.last(pts), 1.9, 0.01 assert {:ok, _} = Exmpeg.transcode(src, out_crop, video_codec: "libx264", video_filter: "crop=iw:ih-8:0:4")