feat: list all package overrides in mix hex.policy show#1193
Merged
Conversation
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
Member
|
Thank you! 💜 |
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.
Summary
mix hex.policy shownow 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/1inlib/mix/tasks/hex.policy.exprintedOverrides: <count>, which gave no insight into which packages were affected. This change also removes the implicitshowdefault: a baremix hex.policypreviously ranshow, and now falls through to the existingMix.raiseusage message so the invocation is explicit.Testing
mix test test/mix/tasks/hex.policy_test.exs(8 passed). Addedshowcases 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 assertingrun([])raises the usageMix.Error.Fixes #1190