Repository navigation
Conversation
Disclaimer: I am an AI (Claude Opus 5.5, made by Anthropic). I wrote
this change, its test, and this message while working for a human
developer, who is submitting it.
PROBLEM
`deno coverage --include` and `--exclude` test each pattern against the
script's URL as V8 reports it. That URL is percent-encoded, so a file
whose path contains a space or any non-ASCII character can only be
matched by writing the escapes into the pattern:
$ deno test --coverage=cov # covers wt 🦆/mod.ts and plain/mod.ts
$ deno coverage cov --include='wt 🦆'
error: No covered files included in the report
$ deno coverage cov --exclude='wt 🦆' # excludes nothing
$ deno coverage cov --exclude='wt%20%F0%9F%A6%86' # works
SOLUTION
A pattern now matches a script when it matches either the URL or the URL
with its percent-escapes decoded. A pattern that names a directory the
way the file system spells it therefore matches. Every pattern that
matched before still matches, including the default `^file:` and any
pattern written against the escaped form.
A spec test covers both flags, with a pattern spelled as on disk and
with one spelled with escapes.
Fixes denoland#37127
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The filter test checked an escaped pattern only with --exclude. It now checks --include the same way, so both flags are tested against the URL as well as against its decoded form. Disclaimer: I am an AI (Claude Opus 5.5, made by Anthropic). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NetOpWibby
pushed a commit
to theende/ende
that referenced
this pull request
Nov 7, 2026
`coverage --include` and `--exclude` matched each pattern against the script URL, which is percent-encoded. A file whose path has a space or a non-ASCII character could only be matched by writing the escapes into the pattern. A pattern now matches if it matches either the URL or the URL with its escapes decoded, so every pattern that matched before still does. Squashed: the PR's second commit adds the test steps that spell the pattern with escapes. (cherry picked from commit cbb96e1525e476070516ff453fee6c883f7dfedb and 53cf966c0c0b77520680fac3457870519108e51e) Upstream: denoland/deno#37128
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.
Disclaimer: I am an AI (Claude Opus 5.5, made by Anthropic). I wrote this change, its test, and this message while working for a human developer, who is submitting it.
PROBLEM
deno coverage --includeand--excludetest each pattern against the script's URL as V8 reports it. That URL is percent-encoded, so a file whose path contains a space or any non-ASCII character can only be matched by writing the escapes into the pattern:SOLUTION
A pattern now matches a script when it matches either the URL or the URL with its percent-escapes decoded. A pattern that names a directory the way the file system spells it therefore matches. Every pattern that matched before still matches, including the default
^file:and any pattern written against the escaped form.A spec test covers both flags, with a pattern spelled as on disk and with one spelled with escapes.
Fixes #37127