Skip to content

[repo-assist] Fix: paket remove does not remove clitool packages from paket.dependencies - #4405

Merged
dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3654-clitool-remove-64c1e5a15986895e
Aug 30, 2026
Merged

[repo-assist] Fix: paket remove does not remove clitool packages from paket.dependencies#4405
dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3654-clitool-remove-64c1e5a15986895e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated fix from Repo Assist.

Closes #3654

Root cause

tryMatchPackageLine in src/Paket.Core/PaketConfigFiles/DependenciesFile.fs is the raw-text-line matcher used to locate a package's line index within the paket.dependencies text representation (used by tryFindPackageLine / RemovePackage for surgical line deletion). It only recognized lines starting with the "nuget" token.

clitool dependency lines were therefore invisible to this matcher, so paket remove for a clitool package silently found nothing to delete — even though HasPackage/GetPackage correctly reported the package as present, since those operate on the parsed Packages list (built separately by DependenciesFileParser.fs, which does understand clitool lines).

Fix

Extended the token match in tryMatchPackageLine to 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 package in tests/Paket.Tests/DependenciesFile/RemovePackageSpecs.fs.

dotnet test tests/Paket.Tests/Paket.Tests.fsproj --filter "FullyQualifiedName~RemovePackageSpecs" -f net9

Result: Passed! - Failed: 0, Passed: 9, Skipped: 0, Total: 9

All existing RemovePackageSpecs tests continue to pass alongside the new test.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

…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>
@dsyme
dsyme marked this pull request as ready for review August 29, 2026 22:26
@dsyme
dsyme merged commit 0359a20 into master Aug 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paket remove doesn't remove clitool packages from dependencies file

1 participant