Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 3 additions & 32 deletions .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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, []},
Expand Down
10 changes: 5 additions & 5 deletions test/integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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")
Expand Down