-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Lack of Show
on many types hurts explorability of the codebase
#2627
Comments
I might be misunderstanding why this happens but codecov checks seem particularly weak with Or maybe it's more pragmatic to just allow the code coverage to drop in those cases. The coverage isn't an end goal in itself, just an indicator, after all. Having more easily explorable and repl friendly code seems worth more to me. One thing we discussed in the previous ticket was to simply have a separate file to derive show on everything. It'd have terrible coverage but everyone would know it's safe to ignore. |
Yeah, I agree.
Ignore the above, Laurence got the idea on #2657. |
Seems that doesn't work according to #2657 (comment). The other option is to just add the |
Pity! I mean, if it were me, I'd just add it to every type everywhere then. Given the current limitations of |
This is not about codecov. This is about hpc and our use of
While 100% code coverage isn't a goal in itself - the problem is with everything below 100%. While you can't be sure to have tested everything you need to, when you have 100% coverage, the inverse is true: If you have any uncovered line, you can be sure that you are missing a test. Well, that is if HPC was smart enough to deal with all language extensions. That means right now, you'd have to look at every uncovered line and decide whether this is ok to be uncovered, either because it's unsupported by HPC or because we are deliberately adding that piece of code without coverage. This adds quite some mental overhead, if you want to do stuff right. This is somewhat easier by only looking at code coverage of changed lines in the GitHub MR - but still. You'll hit that very often. It also just distracts from those tests that matter, because you are forced to look at very basic lines without much logic or complexity. If coverage is 100% you can be sure to have covered all that simple stuff and it's much simpler to focus on those tests that actually matter. At least that's how I feel about it.
Yeah, that separate file seems hard to do. How about adding But yeah, maybe that's only useful when this is actually the last thing separating us from 100%. While HPC still doesn't support record syntax, it doesn't really make that much of a difference, I guess. |
Yeah, I totally get what you're saying. With the current limitations, reaching 100% coverage is sysiphean though, so all I'm saying is let's use it for what it can be used for now. We can use the percentage as a relative indicator to confirm PRs are generally increasing or maintaining coverage.
No objections to that. |
This continues to be painful everytime I need it. For example for debugging #2846. @wolfgangwalther Would you be opposed to me adding the Show instances and just letting coverage drop? I assume it wouldn't drop too much and we could leave it as TODO. Additionally seems #1713 is another way to fix these drops? Opened #2847 |
Sure, go ahead. |
Say I want to explore some functions of the
MediaType
module with the cabal repl, the following will fail:If I add the required Show instances(manually, which turns into a chore quickly):
It will now succeed:
This is also a problem for debugging because one cannot do simple
traceShow
like previously discussed here #2523 (comment)Code coverage is the main reason for removing those
Shows
. How can we include them again for all types and still pass the codecov checks?cc @wolfgangwalther
The text was updated successfully, but these errors were encountered: