Credo: ExSlop's checks too

142495f · 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
@@ -40,6 +40,7 @@ defmodule LambentEx.MixProject do
40 40 defp deps do
41 41 [
42 42 {:credo, "~> 1.7", only: [:dev, :test], runtime: false},
43 + {:ex_slop, "~> 0.4", only: [:dev, :test], runtime: false},
43 44 {:phoenix, "~> 1.7", override: true},
44 45 {:phoenix_html, "~> 3.0"},
45 46 {:phoenix_live_reload, "~> 1.2", only: :dev},
modified mix.lock
+1 −0
@@ -11,6 +11,7 @@
11 11 "elixir_make": {:hex, :elixir_make, "0.10.0", "16577e2583a79bb79237bbff349619ef5d80afffc07eac6e4faf0d00e2ddaf7d", [:mix], [], "hexpm", "dc1f09fb7fa68866b886abd5f0f3c83553b1a19a52359a899e92af1bb3b31982"},
12 12 "eqrcode": {:hex, :eqrcode, "0.2.1", "d12838813e8fc87b8940cc05f9baadb189031f6009facdc56ff074375ec73b6e", [:mix], [], "hexpm", "d5828a222b904c68360e7dc2a40c3ef33a1328b7c074583898040f389f928025"},
13 13 "esbuild": {:hex, :esbuild, "0.10.0", "b0aa3388a1c23e727c5a3e7427c932d89ee791746b0081bbe56103e9ef3d291f", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "468489cda427b974a7cc9f03ace55368a83e1a7be12fba7e30969af78e5f8c70"},
14 + "ex_slop": {:hex, :ex_slop, "0.4.5", "4e3ea38397d08d422f8e92e4cef16877e4a31a93c6abd07b494f4458e37c3ce2", [:mix], [{:credo, "~> 1.7", [hex: :credo, repo: "hexpm", optional: false]}], "hexpm", "174c1ce4da612f7d3e93734d08d81d93774bacb6a8e86123e7d6876369a2df81"},
14 15 "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
15 16 "finch": {:hex, :finch, "0.24.0", "4022b6194e907b6d9b597c168001cac38e488a35fe36cef9d8297e3159782510", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.8", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "33ba40069c3587c2f99f9125b766e19dad87d6d54be3c6961db2304df04cef00"},
16 17 "fine": {:hex, :fine, "0.1.6", "4bf7151493443c454aac9f2fa2f34f5fefd0346a83fb5586a016c4a135c63247", [:mix], [], "hexpm", "5638eb4495488e885ebec167fa57973e5c35e1a50c344eb7666c90ec1c4e3b12"},

Parents: f922cf9