Skip to content

fix: raise a clear error when a validate argument matches no files - #90

Merged
zachdaniel merged 2 commits into
ash-project:mainfrom
lukegalea:validate-empty-glob
Oct 2, 2026
Merged

zachdaniel merged 2 commits into
ash-project:mainfrom
lukegalea:validate-empty-glob

Conversation

@lukegalea

Copy link
Copy Markdown
Contributor

Follow-up to #88. mix usage_rules.validate passed its arguments straight to ex_doc, so a glob that matched nothing (shells pass those through unexpanded) or a missing path ended in a File.Error from ExDoc.Extras.build_extra/3.

Arguments are now expanded with Path.wildcard/1 and filtered to regular files. Any argument that matches nothing raises a Mix.Error naming it. An argument that is an existing file is used as-is, so file names containing glob characters (e.g. [draft].md) still work.

Tests cover a missing glob and a missing file (both named in the error), a pattern matching only directories, and a literal file name with glob characters.

🤖 Generated with Claude Code

lukegalea and others added 2 commits October 2, 2026 02:56
`mix usage_rules.validate <glob>` passed arguments straight to ex_doc, so a
glob the shell left unexpanded (or a missing path) ended in a File.Error
from ExDoc.Extras.build_extra/3. Arguments are now expanded with
Path.wildcard/1 and filtered to regular files; any argument that matches
nothing raises a Mix error naming it. An argument that is an existing file
is used as-is, so file names containing glob characters still work.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The reference validator calls into ExDoc behind Code.ensure_loaded?/1, but
ex_doc is a dev/test-only dependency with runtime: false, so it was missing
from the PLT and dialyzer reported 12 "function does not exist" errors for
ExDoc.Config, ExDoc.Formatter, ExDoc.Extras and ExDoc.Markdown calls. This
has failed the dialyzer job on main since ash-project#88.
@zachdaniel
zachdaniel merged commit 67c3f52 into ash-project:main Oct 2, 2026
26 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

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