Skip to content

feat: list all package overrides in mix hex.policy show#1193

Merged
ericmj merged 1 commit into
hexpm:mainfrom
mvanhorn:feat/1190-policy-show-list-overrides
Jul 1, 2026
Merged

feat: list all package overrides in mix hex.policy show#1193
ericmj merged 1 commit into
hexpm:mainfrom
mvanhorn:feat/1190-policy-show-list-overrides

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

mix hex.policy show now lists each package override per repository (package name, version requirement when present, and ALLOW or DENY) instead of printing only a count, so users can see exactly which packages a policy explicitly allows or denies. A repository with no overrides renders a (none) placeholder.

Why this matters

Issue #1190 asks for the overrides to be enumerated rather than summarized as a number. The old render_repository/1 in lib/mix/tasks/hex.policy.ex printed Overrides: <count>, which gave no insight into which packages were affected. This change also removes the implicit show default: a bare mix hex.policy previously ran show, and now falls through to the existing Mix.raise usage message so the invocation is explicit.

Testing

mix test test/mix/tasks/hex.policy_test.exs (8 passed). Added show cases asserting each override line renders the package, requirement, and ALLOW/DENY, and that an empty override list prints (none). Replaced the old "bare invocation defaults to show" test with one asserting run([]) raises the usage Mix.Error.

Fixes #1190

List each package override (package, requirement, ALLOW/DENY) in the
per-repository output of mix hex.policy show instead of only printing a
count, and render a (none) placeholder when a repository has no
overrides. Drop the implicit show default so a bare mix hex.policy now
raises the usage message instead of silently running show.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQ7G74DcZPFPEgDJMTEcCR
@ericmj ericmj merged commit 5f38ba5 into hexpm:main Jul 1, 2026
13 checks passed
@ericmj

ericmj commented Jul 1, 2026

Copy link
Copy Markdown
Member

Thank you! 💜

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.

mix hex.policy show should list all package overrides

2 participants