Skip to content

fix(adhoc-packages): match add in the subcommand position for pnpm/yarn - #2386

Merged
woodruffw merged 3 commits into
zizmorcore:mainfrom
marcalexiei:fix/adhoc-packages-pnpm-subcommand
Sep 15, 2026
Merged

woodruffw merged 3 commits into
zizmorcore:mainfrom
marcalexiei:fix/adhoc-packages-pnpm-subcommand

Conversation

@marcalexiei

Copy link
Copy Markdown
Contributor

Pre-submission checks

Please check these boxes:

  • Mandatory: This PR corresponds to an issue (if not, please create
    one first).

  • Having read the AI policy, I hereby disclose the use of an LLM or other
    AI coding assistant in the creation of this PR. PRs will not be rejected
    for using AI tools, but will be rejected for undisclosed use or
    use that violates the policy.

If a checkbox is not applicable, you can leave it unchecked.

Summary

adhoc-packages matched add anywhere in a yarn/pnpm command,
so commands that dispatch to another tool like:

  • pnpm exec changeset add
  • pnpm run build add lodash

were reported as ad-hoc installs.

add now has to be the subcommand:
the first argument after any leading flags and their values.

These commands are still flagged:

  • pnpm -r add lodash
  • pnpm -C ./sub add lodash
  • pnpm --filter ./pkgs/core/ add lodash
  • pnpm --filter=./pkgs/core/ add lodash
  • yarn workspace @acme/core add lodash

The yarn and pnpm cases are now merged.

Test plan

  • cargo test -p zizmor --bins test_is_adhoc_install_command
  • cargo test -p zizmor --test integration adhoc (no snapshot changes)

@woodruffw

Copy link
Copy Markdown
Member

Hi @marcalexiei, thanks for the PR. I'm taking a look now.

@woodruffw woodruffw added bugfix Fixes a known bug false-positive labels Sep 15, 2026
@woodruffw
woodruffw force-pushed the fix/adhoc-packages-pnpm-subcommand branch from 9ed89d3 to 71fb088 Compare September 15, 2026 02:51
@woodruffw
woodruffw merged commit 05c244e into zizmorcore:main Sep 15, 2026
14 checks passed
@woodruffw

Copy link
Copy Markdown
Member

Thanks @marcalexiei!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a known bug false-positive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: adhoc-packages – pnpm match add anywhere in the argument list, not in the subcommand position

2 participants