-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add a CLI flag to silence warnings from :cover
module
#239
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR. The I'm searching around, |
Yep, that code comes from Erlang. I'm no lawyer, but if there's some reason you can't include that code here then I totally understand. That is unfortunately the only way to solve this issue, though, so if this doesn't work then this issue will need to be closed and marked as something that cannot be solved. |
I'm facing this annoying warning but I still can't figure out the real reason of this message. |
@parroty just needs attribution as both MIT and Apache 2.0 are permissive - as long as individual source files include the license and attribution. I'd like to see this get merged. |
We've been running into this as well. It's terribly annoying. It looks like I don't like the idea of vendoring a modified version. We could upstream changes that introduce |
@parroty any chance we can merge this PR soon or if you disagree close this as "won't fix" ? |
Thank you for the follow-up. I didn't have good timing to dig this up, and sorry about the lack of responses.
I am not confident about this licensing part enough yet. Is it possible for you to elaborate this "needs attribution" part? (What needs to be included in this repository?). Thanks in advance. |
https://www.erlang.org/EPLICENSE
It's my understanding that prefixing the modified cover.erl with the EPLICENSE text as a comment would be sufficient.
I'd like that, much better option if we can get a patch upstream. |
FWIW, I've got around the issue by patching cover.erl to remove the warnings and then added that under src/ in my project. |
Bump |
This needs to be merged ASAP. |
@deepfryed Thank you for the comment.
The file in this PR (
I am not in favor of vendoring a modified version..., but if it can avoid license issues, I am inclined to include this feature with |
Also, this can be a reasonable workaround? |
@parroty I don't think that people should have to patch cover.erl to remove these warnings. The PR is here, why not just merge it? I get this all the time when using Mock, which is a fundamental part of testing to begin with. As an alternative, we could add how to manually patch cover.erl in README.md, but IMHO it's a feature that should be a part of the official package. It's reasonable to be able to silence these warnings, especially because unnecessary console output drastically slows down test suites. |
Wouldn't the right approach here be to first upstream some changes to It doesn't seem right to copy all of that here. |
Could anyone give a hand for this part? 🙇 Merging of this PR itself might be one solution, but it would be only for short-term (temporary) one.
Also, it would be great if anyone can PR this README option, assuming that there's no harm writing the procedure as temporary solution 🙇 . |
FWIW, I think cover.erl patch belongs in OTP. I'd be fine with someone submitting that patch upstream and instructions in README in the interim that can guide people on adding a patched cover.erl to src/ in their projects. |
Yes
I'll send you a PR tomorrow to review, unless someone else beats me to it. |
This introduces a new CLI flag
--no-warn-cover
, which will silence the warnings that we get from:cover
.Those warnings are often the result of using mocks (especially if you're using
:meck
), and thereforecan be ignored.
Unfortunately there's no flag or anything that turns this off in the default
:cover
module, which is whywe need to use our own copy of that module here. Luckily that module has barely changed in over 5
years, and so it's stable and safe to copy in this fashion.
Resolves #230