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(cli): ensure empty lines don't count towards coverage #11957

Merged
merged 29 commits into from
Oct 6, 2021

Conversation

caspervonb
Copy link
Contributor

@caspervonb caspervonb commented Sep 8, 2021

This cleans up coverage by computing the result ahead of time and passing that as-is into the reporter(s).
Doing so, I made sure to throw out empty lines.

Fixes #11327

One known issue, empty lines in transpiled source don't map well.
Main issue here is that range[0] which is the evaluation range gets
expanded to include everything.

This in turn marks non-executable lines inside the extended range as
executable even when they are not.
@caspervonb
Copy link
Contributor Author

caspervonb commented Sep 8, 2021

All of the mapping and lookups in this is a prime candidate to make use of the denoland/deno_ast utilities (in a follow up).

@caspervonb caspervonb changed the title wip: refactor and fix coverage fix(cli): ensure empty lines don't count towards coverage Sep 21, 2021
@caspervonb caspervonb marked this pull request as ready for review September 21, 2021 14:59
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, thank you and sorry it took so long to land.

@bartlomieju bartlomieju merged commit d5b38a9 into denoland:main Oct 6, 2021
@caspervonb caspervonb deleted the refactor-coverage branch October 6, 2021 05:54
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Oct 6, 2021
bartlomieju added a commit that referenced this pull request Oct 6, 2021
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Oct 10, 2021
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Oct 10, 2021
@zandaqo
Copy link

zandaqo commented Oct 19, 2021

Since this PR has been reverted, is there any other PR/work in progress to fix coverage that we can follow?

@bartlomieju
Copy link
Member

Since this PR has been reverted, is there any other PR/work in progress to fix coverage that we can follow?

Unfortunately not

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.

A final blankline in a file prevents 100% code coverage
3 participants