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

Files with 0 lines should have 100% coverage by default #87

Closed
hauleth opened this issue Nov 27, 2016 · 7 comments
Closed

Files with 0 lines should have 100% coverage by default #87

hauleth opened this issue Nov 27, 2016 · 7 comments

Comments

@hauleth
Copy link
Contributor

hauleth commented Nov 27, 2016

Currently it reports that such files have 0% coverage.

@joshsmith
Copy link
Collaborator

This is an interesting problem. I would think that even though there are zero executable lines of code, it's still technically correct to say that there is 0% coverage of that file.

What use case do you have where you have a completely empty file in your project?

@hauleth
Copy link
Contributor Author

hauleth commented Nov 28, 2016

For example (almost) default Phoenix Repo module

defmodule MyApp.Repo do
  use Ecto.Repo, otp_app: :my_app

  @dialyzer {:nowarn_function, rollback: 1}
  @dialyzer {:nowarn_function, insert_or_update: 2}
  @dialyzer {:nowarn_function, insert_or_update!: 2}
end

Which has no unused lines and no used lines (even if it is used during tests). I believe that in such case (0 SLOC and 0 covered lines) there should be automatically 100% coverage.

@joshsmith
Copy link
Collaborator

Thanks, that's a good example!

@parroty
Copy link
Owner

parroty commented Jan 6, 2017

Thanks for the feedback.
There was related item (#7 has some description). What do you think about applying the option in coveralls.json?

@hauleth
Copy link
Contributor Author

hauleth commented Jan 6, 2017

I think that this can be used as a temporary workaround, but it should be default behaviour.

@parroty
Copy link
Owner

parroty commented Jan 6, 2017

OK, understood the point. Also, I've rechecked the coveralls.io output and it seems they're taking it as 100% (though not sure when changed). I'll be changing the default to 100%.

@parroty
Copy link
Owner

parroty commented Jan 6, 2017

Thanks for the comment and sorry being late to respond. I'm closing by pushing as v0.6.0, but if you find further issue/comment, please reopen.

@parroty parroty closed this as completed Jan 6, 2017
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

No branches or pull requests

3 participants