Validates module, function, and file references found in the
files generated and managed by mix usage_rules.sync, using ex_doc's own
autolink pipeline. Warnings are ex_doc's own, printed with file/line
information — the same warnings a HexDocs build would emit over the same
content. See UsageRules.Validator for exactly what is and is not
checked.
ex_doc must be compiled and available. It is already a dev dependency of most Hex packages; when it is missing, the task fails with an actionable error telling you how to add it.
By default, only rules-managed files are validated:
- the composed file from the
:fileoption of your:usage_rulesconfig (e.g.AGENTS.md) *.mdfiles under skills managed by usage-rules (skills whoseSKILL.mdcontainsmanaged-by: usage-rules)
Explicit file paths or glob patterns can also be given to validate those instead. Every argument must match at least one file; the task fails, naming the argument, when one does not.
Examples
$ mix usage_rules.validate
$ mix usage_rules.validate AGENTS.md usage-rules.md
$ mix usage_rules.validate "docs/**/*.md"
Exit status
Exits with a nonzero status when ex_doc emits any warning, making the task suitable for CI.