Skip to content

feat(cli): name the existing tags when --tag matches nothing - #1266

Merged
Chemaclass merged 1 commit into
mainfrom
feat/tag-hint
Aug 15, 2026
Merged

feat(cli): name the existing tags when --tag matches nothing#1266
Chemaclass merged 1 commit into
mainfrom
feat/tag-hint

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #1265

A mistyped --filter has explained itself since #1237, but a mistyped --tag still ended on a bare No tests found. Tags are worse off: a filter matches a function name, which is visible in any normal run, while a tag exists only inside # @tag comments and nothing lists them — --list-format json reports the tags of the tests it selected, which is empty exactly when you need them.

💡 Changes

  • An empty --tag selection now names the tags the run actually saw: No test matches tag 'integraton'. Tags in the selected files: integration,slow.
  • A selection with no tags anywhere says so instead — a different mistake, where naming an empty list would say nothing
  • Tag names accumulate as each file is scanned, because the tags map is cached per script and only the last file's would otherwise reach the summary; per file, not per test, and only rendered on a run that already selected nothing

A tag is a user-defined string that appears only in `# @tag` comments, and
nothing lists them: `--list --list-format json` reports the tags of the tests
it selected, which is empty precisely when the selection failed. So a typo'd
`--tag` left a bare "No tests found" with no way back, while a typo'd
--filter has had a hint since #1237.

The tags map is cached per script, so only the last file's would survive to
the summary; the names are accumulated as each file is scanned instead. That
is per file, not per test, and the hint only renders on a run that already
selected nothing.

An untagged selection gets a different message, because it is a different
mistake: naming an empty list would say nothing.

Closes #1265
@Chemaclass Chemaclass added the enhancement New feature or request label Aug 15, 2026
@Chemaclass Chemaclass self-assigned this Aug 15, 2026
@Chemaclass
Chemaclass merged commit f19c25c into main Aug 15, 2026
37 checks passed
@Chemaclass
Chemaclass deleted the feat/tag-hint branch August 15, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant