Fix report-only scan -g hint dropping -g (#464) - #777
Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A report-only `scan -g` (or `--global-prefix <dir>`) ends with a hint for applying what it found. The hint dropped the global flag, so running it as printed scanned the cwd project instead, exited 0, and left the global install unpatched. The hint now repeats the run's scope: `-g`, or `--global-prefix <dir>` shell-quoted when the path needs it. A project `--prune` scan keeps the old hint. Covered by unit tests on the hint and an integration test of a real report-only global-prefix scan. Fixes #464 Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 4, 2026 12:48
Collaborator
Author
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b311073. Configure here.
Collaborator
Author
|
[agent] Ready for review at
Generated by Claude Code |
This branch has not been deployed
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.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #464
Summary
scan -gandscan --global-prefix <dir>with no--modeonly report. They end with a hint showing how to apply what they found. The hint used to drop the global scope:If you ran it as printed, it scanned the cwd project instead of the global install, exited 0, and left the global copy unpatched. The hint now repeats the run's scope:
With a prefix, it prints
--global-prefix '<dir>'instead, shell-quoted only when the path needs it (POSIX single quotes; double quotes on Windows). A project--prunereport-only scan keeps the old hint.Root cause
render::report_only_hint()took no arguments, so it never saw the run'sGlobalArgs. It now takes&GlobalArgsand builds both commands fromglobal/global_prefix.SOCKET_GLOBAL/SOCKET_GLOBAL_PREFIXset the same fields, so they're covered too. CLI_CONTRACT.md documents the scoped hint.The npm, PyPI and gem wrappers only dispatch to the binary, so they need no change.
Tests (red → green)
-g,--global-prefix, quoting)scan::render::tests::report_only_hint_keeps_global_scope(unit)covgap_commands_scan_mod::scan_global_report_only_hint_keeps_the_global_scopesocket-patch scan --mode agent [PATHS]report_only_hint_names_agent_mode,scan_prune_without_a_mode_is_report_onlyCommands run locally on
b311073:cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-cli --all-features --lib: 835 passed.cargo test -p socket-patch-cli --all-features --test covgap_commands_scan_mod --test cli_parse_scan --test e2e_socket_yml_policy: 45 + 52 + 20 passed.cargo fmt --check: my hunks are clean.mainalready has about 500 rustfmt diffs under the pinned 1.93.1 toolchain, and CI doesn't run fmt, so I didn't reformat unrelated code.cargo test --workspacefilled the sandbox disk while linking test binaries, so the full suite is left to CI.🤖 Generated with Claude Code
Generated by Claude Code