Skip to content

fix(core): strip surrounding quotes from package-script file tokens#852

Open
BartWaardenburg wants to merge 1 commit into
mainfrom
fix/issue-841-node-test-quoted-glob
Open

fix(core): strip surrounding quotes from package-script file tokens#852
BartWaardenburg wants to merge 1 commit into
mainfrom
fix/issue-841-node-test-quoted-glob

Conversation

@BartWaardenburg
Copy link
Copy Markdown
Collaborator

DRAFT: Reviewer verdict is FIX (not SHIP). One clippy-blocking issue must be resolved before this can land. See the Review section below.

Summary

Adds a strip_surrounding_quotes helper to crates/core/src/scripts/mod.rs and applies it via .map(strip_surrounding_quotes) when collecting tokens in parse_command_segment. A quoted glob like 'src/**/*.test.ts' now has its surrounding single quotes stripped before looks_like_file_path is called, so the token is recognised as a file-path argument and stored without quotes. An internal single quote (e.g. can't) is left unchanged. Three regression tests cover: quoted glob, unquoted glob (unchanged behaviour), and a direct unit test of the strip helper.

Review

Verdict: FIX

  • BLOCK (CI-blocking clippy failure): strip_surrounding_quotes is declared pub(crate) fn inside the private pub(crate) mod scripts module (crates/core/src/scripts/mod.rs:300). The clippy nursery lint redundant_pub_crate fires, and under the project's -D warnings gate this is a hard compile error. The fix is one character: change pub(crate) fn strip_surrounding_quotes to fn strip_surrounding_quotes. The helper has no cross-module caller; the child tests module reaches it via super::, which works with private visibility.
  • Non-blocking (pre-existing limitation): The whitespace tokenizer cannot strip quotes from a quoted argument containing internal spaces (e.g. 'foo bar.ts' splits into 'foo and bar.ts', neither gets stripped). This is not introduced or worsened by this fix; acceptable to leave for the scoped Quoted globs in node --test scripts are not registered as entry points (surrounding quotes not stripped) #841 case.

What remains before merge

  • Remove the pub(crate) visibility qualifier from strip_surrounding_quotes (change to bare fn) to fix the clippy gate.

Closes #841

@BartWaardenburg BartWaardenburg force-pushed the fix/issue-841-node-test-quoted-glob branch from c42afbd to 889c7ae Compare June 1, 2026 21:52
@BartWaardenburg BartWaardenburg marked this pull request as ready for review June 1, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quoted globs in node --test scripts are not registered as entry points (surrounding quotes not stripped)

1 participant