Repository navigation
CLI: deps remove, deps pin, deps list - #154
Merged
Merged
Conversation
remove takes a dependency's entry out of config.idp, refusing (and listing each use by file and line) while a schema still imports it; --dry-run shows the entry. pin re-resolves a dependency the way add does and rewrites its hash to the content just compiled, optionally moving a git dependency to another commit (--commit with --version) and running add's @Unverified acceptance when the new content gives up more. list prints each declared dependency's source, pin and accepted protocols from config.idp alone, as text or --json. Each edit changes only the affected entry; the rest of config.idp is left as written.
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.
Adds three subcommands to
comline deps, next toaddandaccept(#153).deps remove NAME [--dry-run]removes NAME's entry fromconfig.idp. If a schema still imports it (use NAME::...) it refuses, listing each use by file and line, and writes nothing (also with--dry-run). Uses are found with core's schema parser, not by text. An unknown NAME lists the declared dependencies.deps pin NAMEre-resolves the dependency the wayadddoes and rewrites itshashto the content just compiled. It never pins what doesn't resolve, prints the old and new hash, writes nothing when they match, and gives an entry without a hash one.--commit SHA --version VERSION(together, git only) moves a git dependency in the same step. If the new content gives up more through@unverifiedthan the entry accepts, it runsadd's accept flow (shown, asked on a terminal, else--accept-unverified).deps list [--json]prints one line per declared dependency: source, pin and what's accepted. It reads onlyconfig.idp: no resolving, no network, no writes.Edits are surgical like
add/accept: only the affected entry changes.accept.rsgains a sharedwith_line(also used byaccept, which now takes the indentation of the field above instead of always one four-space level) andentry_at.declared_dependenciesnow returns entries sorted by name (core hands them back from aHashMap). Docs:docs/cli.md, README, and thedepshelp. Tests intests/cli/{remove,pin,list}.rs; the package helpers moved fromadd.rstoutil.rs.Draft until CI has run the suite.