app: give credo checks one load path (fixes redefining-module warning)

lib_dev/ was both compiled (elixirc_paths for :dev and :test) and source-loaded
by credo through `requires:` in .credo.exs. Two load paths for one module means
that whenever _build/dev already holds the beam, `mix credo` warned:

    warning: redefining module Firehose.Checks.NoConnShadowing
    (current version loaded from _build/dev/.../Elixir.Firehose.Checks.NoConnShadowing.beam)

Keep the explicit contract and drop the accidental one: `requires:` is the
documented way for credo to load project checks, so lib_dev/ now leaves
elixirc_paths in every environment. Nothing under test/ referenced the check, so
the :test entry was dead as well, and credo compiles the file on every run
anyway, so the check still gets compiled — just once.

One-time migration for checkouts that already built it:
`mix clean` (or delete _build/dev) to drop the stale beam; until then the old
warning persists. Fresh clones are unaffected.
This commit is contained in:
Willem van den Ende
2026-10-26 20:01:33 +00:00
parent f54ce2fab7
commit 9730987846
2 changed files with 14 additions and 2 deletions
+5
View File
@@ -41,6 +41,11 @@
# If you create your own checks, you must specify the source files for
# them here, so they can be loaded by Credo before running the analysis.
#
# This is the ONLY load path for lib_dev/ checks: the directory is kept out
# of elixirc_paths in mix.exs on purpose, so the module is not also loaded
# from a compiled .beam (that double load produced
# "warning: redefining module Firehose.Checks.NoConnShadowing").
#
requires: ["lib_dev/firehose/checks/"],
#
# If you want to enforce a style guide and need a more traditional linting