[repo-assist] Fix: paket remove does not remove clitool packages from paket.dependencies - #4405
Merged
dsyme merged 1 commit intoAug 30, 2026
Conversation
…ncies Closes #3654 Root cause: tryMatchPackageLine in DependenciesFile.fs only matched raw text lines starting with the 'nuget' token, so clitool lines were never located by tryFindPackageLine, causing RemovePackage to silently no-op for clitool dependencies (even though HasPackage/ GetPackage worked, since those operate on the parsed package list). Fix: extend the token match to accept both 'nuget' and 'clitool' line prefixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 This is an automated fix from Repo Assist.
Closes #3654
Root cause
tryMatchPackageLineinsrc/Paket.Core/PaketConfigFiles/DependenciesFile.fsis the raw-text-line matcher used to locate a package's line index within thepaket.dependenciestext representation (used bytryFindPackageLine/RemovePackagefor surgical line deletion). It only recognized lines starting with the"nuget"token.clitooldependency lines were therefore invisible to this matcher, sopaket removefor a clitool package silently found nothing to delete — even thoughHasPackage/GetPackagecorrectly reported the package as present, since those operate on the parsedPackageslist (built separately byDependenciesFileParser.fs, which does understandclitoollines).Fix
Extended the token match in
tryMatchPackageLineto accept either"nuget"or"clitool"as a valid line prefix. This is a minimal, one-line change with no other behavioral impact.Trade-offs
None expected — this purely restores functionality that was clearly intended (clitool packages are a first-class dependency kind elsewhere in the codebase) and doesn't change any other code paths.
Test Status
Added a regression test
should remove a clitool packageintests/Paket.Tests/DependenciesFile/RemovePackageSpecs.fs.Result: Passed! - Failed: 0, Passed: 9, Skipped: 0, Total: 9
All existing
RemovePackageSpecstests continue to pass alongside the new test.Add this agentic workflow to your repo
To install this agentic workflow, run