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

[proposal] exclude generated files from code coverage #768

Closed
iapicca opened this issue Nov 2, 2022 · 3 comments
Closed

[proposal] exclude generated files from code coverage #768

iapicca opened this issue Nov 2, 2022 · 3 comments

Comments

@iapicca
Copy link

iapicca commented Nov 2, 2022

Use case

currently generated files negatively affect code coverage

Proposal

add the comment // coverage:ignore-file,
made available by dart tools coverage (see dart-archive/coverage#302),
to the generate files to exclude these from coverage

cc @osa1

@iapicca iapicca changed the title exclude generated files from code coverage [proposal] exclude generated files from code coverage Nov 2, 2022
@osa1
Copy link
Member

osa1 commented Nov 2, 2022

Thanks for the ping. Could you give us some context please? What is coverage? How do you run it? What's the problem not having // converage:... causes?

Sorry I replied to the original version of your issue (before the edits). I think this makes sense. I'm on vacation this week but we'll discuss this next week and then I'll update.

@osa1
Copy link
Member

osa1 commented Nov 10, 2022

Hi @iapicca. We discussed this briefly and coverage devs opened an issue for adding a command line flag to coverage to ignore files: dart-lang/tools#510. This coverage feature is much more general, you can ignore files generated by other code generators as well, and with that feature we don't need to change anything in this library.

@iapicca
Copy link
Author

iapicca commented Nov 10, 2022

Fair enough, thanks for checking this out @osa1

For anyone that is reading this issue and uses codecov
you may also add to your codecov.yml

ignore:
  - '**/*.pb.dart'

@iapicca iapicca closed this as completed Nov 10, 2022
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 a pull request may close this issue.

2 participants