Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(coverage): handle ignore patterns #23974

Merged
merged 2 commits into from
May 28, 2024
Merged

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented May 24, 2024

--ignore pattern is currently matched against the coverage raw data path (<UUID>.json) and doesn't work as ignore pattern.

This PR adds the path pattern checks against url property of each json object, and excludes the ignored patterns correctly.

closes #23972

@kt3k kt3k requested review from bartlomieju and dsherret May 24, 2024 12:17
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM

let url = Url::parse(&new_coverage.url)?;
if exclude_patterns.matches_specifier(&url) {
coverages.push(new_coverage);
}
Copy link
Member

Choose a reason for hiding this comment

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

I got confused thinking that this condition should be flipped. Maybe we should rename exclude_patterns to something else? coverage_patterns maybe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, right. coverage_patterns sounds better. Updated!

@kt3k kt3k merged commit d99c6c1 into denoland:main May 28, 2024
17 checks passed
@kt3k kt3k deleted the fix-coverage-ignore branch May 28, 2024 03:37
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.

coverage: --ignore flag for deno coverage command doesn't work
3 participants