[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable files

Open Beginner friendly
#6,296 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ZYZ666-RGB is already working on this.

Since Nov 26, 2026.

  • #6326 by @ZYZ666-RGB — open

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
elixir, python
Domain
devtools

Research direction

Start in packages/core/src/repowise/core/analysis/dead_code/constants.py at the _NEVER_FLAG_PATTERNS tuple, next to the existing seed and migrations entries and the alembic versions pattern. Add root and nested forms for .formatter.exs, .credo.exs, config/.exs and priv/.exs. Done when tests/unit/dead_code/test_convention_never_flag.py covers each pattern at the root and under apps/x/, a negative lib/x.ex case passes, and test_never_flag_regex.py stays green.

Written by the indexing model from the issue text.

Description

bug good first issue

Summary

Mix and its tools read these files by path, so nothing imports them, and the never-flag list has no Elixir entries. Each is reported as an unreachable_file.

packages/core/src/repowise/core/analysis/dead_code/constants.py:43

_NEVER_FLAG_PATTERNS: tuple[str, ...] = (

Mechanism

  • The list exempts run-by-name files such as *.sh, *.trigger and *conftest.py; no .exs path is in it.
  • .formatter.exs and .credo.exs are read by the formatter and linter, config/*.exs by Mix at boot, and data files under priv/ by Code.eval_file or File.read!.
  • priv/repo/seeds.exs and priv/repo/migrations/*.exs are already covered by *seed* (:66) and *migrations* (:64).
  • Precedent: */alembic/versions/*.py (:60), added for reflectively loaded files. A */x/* pattern does not match a root-level x/ path, so root and nested forms both need an entry.

Repro

mix.exs, lib/demo.ex, lib/demo/langs.ex (Code.eval_file(... "data/langs.exs"))
.formatter.exs, .credo.exs, config/config.exs, config/runtime.exs
priv/data/langs.exs, priv/repo/seeds.exs

repowise init --mode fast --no-prose, then repowise dead-code on main:

| unreachable_file | .credo.exs          |        40% |   ✗    |     1 | File has no importers (in_degree=0) |
| unreachable_file | .formatter.exs      |        40% |   ✗    |     1 | File has no importers (in_degree=0) |
| unreachable_file | config/config.exs   |        40% |   ✗    |     2 | File has no importers (in_degree=0) |
| unreachable_file | config/runtime.exs  |        40% |   ✗    |     2 | File has no importers (in_degree=0) |
| unreachable_file | priv/data/langs.exs |        40% |   ✗    |     1 | File has no importers (in_degree=0) |

Impact

Config and formatter files show up as deletion candidates on every Elixir repo.

Done looks like

  • Add .formatter.exs, .credo.exs, config/*.exs, priv/*.exs and their nested forms (umbrella apps/*/config/, apps/*/priv/) to _NEVER_FLAG_PATTERNS.
  • lib/**/*.ex and .exs files outside those paths stay reportable.
  • Path rules only; no change to repowise.core.code_origin.
  • Good first issue: one constant and a clear test.

Tests

tests/unit/dead_code/test_convention_never_flag.py: one case per pattern at the root and under apps/x/, plus a negative lib/x.ex. test_never_flag_regex.py must stay green.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.