Repository navigation
fix: raise a clear error when a validate argument matches no files - #90
Merged
Merged
Conversation
`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.
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #88.
mix usage_rules.validatepassed its arguments straight to ex_doc, so a glob that matched nothing (shells pass those through unexpanded) or a missing path ended in aFile.ErrorfromExDoc.Extras.build_extra/3.Arguments are now expanded with
Path.wildcard/1and filtered to regular files. Any argument that matches nothing raises aMix.Errornaming 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