Skip to content

feat: suppress passthrough message when filter exists but flags excluded it#36

Merged
edouard-claude merged 1 commit intoedouard-claude:masterfrom
jspelletier:remove-misleading-nofilter-message
Apr 16, 2026
Merged

feat: suppress passthrough message when filter exists but flags excluded it#36
edouard-claude merged 1 commit intoedouard-claude:masterfrom
jspelletier:remove-misleading-nofilter-message

Conversation

@jspelletier
Copy link
Copy Markdown
Contributor

@jspelletier jspelletier commented Apr 15, 2026

Previously, running a command like go test -v would print "snip: no filter for 'go'" even though a go-test filter exists. The message was misleading because the filter was simply bypassed due to an exclude_flag (-v), not missing entirely.

Now the message is only shown when no filter is registered at all for that command. Commands excluded by flags pass through silently.

Example from the snip repo:
Before:

:~/snip$ snip go test -v
snip: no filter for "go", passing through -- you can run "go" directly
=== RUN   TestRun_VersionFlag
[rest of output stripped...]

After:

:~/snip$ snip go test -v
=== RUN   TestRun_VersionFlag
[rest of output stripped...]

…ded it

Previously, running a command like `go test -v` would print
"snip: no filter for 'go'" even though a go-test filter exists.
The message was misleading because the filter was simply bypassed
due to an exclude_flag (-v), not missing entirely.

Now the message is only shown when no filter is registered at all
for that command. Commands excluded by flags pass through silently.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

@edouard-claude edouard-claude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Fix ciblé et bien motivé, conforme aux conventions du projet.

Suggestions non bloquantes pour une future itération :

  • Ajouter un test HasAnyFilter pour le cas command-only (filtre npm sans sous-commande doit matcher n'importe quelle sous-commande).
  • Ajouter un test d'intégration pipeline qui capture stderr pour valider que le message est bien muet quand un filtre est exclu par flags.

@edouard-claude edouard-claude merged commit 1c9921b into edouard-claude:master Apr 16, 2026
3 checks passed
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.

2 participants