Skip to content

Replace deprecated xref: [exclude:] with elixirc_options: [no_warn_undefined:]#488

Merged
ericmj merged 1 commit into
elixir-mint:mainfrom
patrols:chore/replace-deprecated-xref-exclude
Jun 5, 2026
Merged

Replace deprecated xref: [exclude:] with elixirc_options: [no_warn_undefined:]#488
ericmj merged 1 commit into
elixir-mint:mainfrom
patrols:chore/replace-deprecated-xref-exclude

Conversation

@patrols

@patrols patrols commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Elixir 1.20 deprecates the project-level xref: [exclude: ...] option:

xref: [exclude: ...] in your mix.exs file is deprecated, instead use: elixirc_options: [no_warn_undefined: ...]

This swaps it for elixirc_options: [no_warn_undefined: ...], which has been the canonical compiler option since Elixir 1.7. mint requires ~> 1.12, so the replacement is valid across the entire supported range — no version gating needed.

The exclusion list is unchanged, so behaviour is identical — the same entries are suppressed: CAStore, {:ssl, :cipher_suites, 1}, {:public_key, :cacerts_get, 0}.

Verified mix compile --force --warnings-as-errors stays clean with the optional castore dep absent — i.e. no_warn_undefined suppresses the CAStore reference exactly as the old xref exclude did.

🤖 Generated with Claude Code

…defined:]

Elixir 1.20 deprecates the project-level `xref: [exclude: ...]` option in favor of
`elixirc_options: [no_warn_undefined: ...]`, which has been the canonical compiler
option since Elixir 1.7. mint requires `~> 1.12`, so the new option is valid across
the entire supported range — no version gating needed.

Behavior is identical: the same modules/MFAs are excluded from undefined-function
warnings. Verified `mix compile --warnings-as-errors` stays clean with castore
(optional) absent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ericmj ericmj merged commit daed2df into elixir-mint:main Jun 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants