Credo: ExSlop's checks too

0a528ae · Gabe Morell · 2026-11-04 21:11

3 files +13 -2
Message
{commit_body(@commit)}

Files changed

modified .credo.exs
+11 −2
@@ -1,10 +1,12 @@
1 1 # Credo's default checks, with two changes: functions may nest one level
2 −# deeper than the default, and @moduledoc isn't required.
2 +# deeper than the default, and @moduledoc isn't required. ExSlop adds its
3 +# recommended checks (https://github.com/elixir-vibe/ex_slop).
3 4 # CI runs `mix credo` as a warning (.forgejo/workflows/credo.yml).
4 5 %{
5 6 configs: [
6 7 %{
7 8 name: "default",
9 + plugins: [{ExSlop, []}],
8 10 files: %{
9 11 included: [
10 12 "lib/",
@@ -19,7 +21,14 @@
19 21 excluded: [~r"/_build/", ~r"/deps/", ~r"/node_modules/"]
20 22 },
21 23 checks: %{
22 − extra: [{Credo.Check.Refactor.Nesting, [max_nesting: 3]}],
24 + extra: [
25 + {Credo.Check.Refactor.Nesting, [max_nesting: 3]},
26 + # Speed checks, which tests don't need: `assert length(x) == 2`
27 + # says more when it fails than a pattern match does.
28 + {ExSlop.Check.Refactor.LengthComparison, [files: %{excluded: [~r"(^|/)test/"]}]},
29 + {ExSlop.Check.Warning.RepoAllThenFilter, [files: %{excluded: [~r"(^|/)test/"]}]},
30 + {ExSlop.Check.Warning.PathExpandPriv, [files: %{excluded: [~r"(^|/)test/"]}]}
31 + ],
23 32 disabled: [{Credo.Check.Readability.ModuleDoc, []}]
24 33 }
25 34 }
modified mix.exs
+1 −0
@@ -41,6 +41,7 @@ defmodule FeedPug.MixProject do
41 41 defp deps do
42 42 [
43 43 {:credo, "~> 1.7", only: [:dev, :test], runtime: false},
44 + {:ex_slop, "~> 0.4", only: [:dev, :test], runtime: false},
44 45 {:bcrypt_elixir, "~> 3.0"},
45 46 {:phoenix, "~> 1.8.5"},
46 47 {:phoenix_ecto, "~> 4.5"},
modified mix.lock
+1 −0
@@ -14,6 +14,7 @@
14 14 "elixir_make": {:hex, :elixir_make, "0.10.0", "16577e2583a79bb79237bbff349619ef5d80afffc07eac6e4faf0d00e2ddaf7d", [:mix], [], "hexpm", "dc1f09fb7fa68866b886abd5f0f3c83553b1a19a52359a899e92af1bb3b31982"},
15 15 "eqrcode": {:hex, :eqrcode, "0.2.1", "d12838813e8fc87b8940cc05f9baadb189031f6009facdc56ff074375ec73b6e", [:mix], [], "hexpm", "d5828a222b904c68360e7dc2a40c3ef33a1328b7c074583898040f389f928025"},
16 16 "esbuild": {:hex, :esbuild, "0.10.0", "b0aa3388a1c23e727c5a3e7427c932d89ee791746b0081bbe56103e9ef3d291f", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "468489cda427b974a7cc9f03ace55368a83e1a7be12fba7e30969af78e5f8c70"},
17 + "ex_slop": {:hex, :ex_slop, "0.4.5", "4e3ea38397d08d422f8e92e4cef16877e4a31a93c6abd07b494f4458e37c3ce2", [:mix], [{:credo, "~> 1.7", [hex: :credo, repo: "hexpm", optional: false]}], "hexpm", "174c1ce4da612f7d3e93734d08d81d93774bacb6a8e86123e7d6876369a2df81"},
17 18 "expo": {:hex, :expo, "1.1.1", "4202e1d2ca6e2b3b63e02f69cfe0a404f77702b041d02b58597c00992b601db5", [:mix], [], "hexpm", "5fb308b9cb359ae200b7e23d37c76978673aa1b06e2b3075d814ce12c5811640"},
18 19 "fast_rss": {:hex, :fast_rss, "0.5.0", "2e79c7142ff7843243635fc3f067999eb26beb0154699f2fa5a39d687629a0c9", [:mix], [{:rustler, "~> 0.29.0", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.6", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "dafb3eccc024d7366a0ef78521a26cfaf2075be534cfe1ec70d72903eabdd44d"},
19 20 "file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"},

Parents: c642ff9