Closed arvidj closed 2 years ago
Thanks. It looks like a good improvement!
I'd request two additional things:
bisect-ppx-report html --tree
or similar. For small projects, the tree adds noise/confusion, especially if they have only one source directory. So, I think the PR should add the per-file statistics to all output, but format the output as a tree only for large projects, when asked to. If you'd like, I can help out with this.bisect-ppx-report html --theme dark
, or set your browser's theme to dark).@ejgallego If you have time, could you try this on Coq? It's the only other really large project I know of that is using/considering Bisect_ppx (https://github.com/coq/coq/pull/12259).
Hi Anton, thanks for your thoughtful comments!
Hiding the nested tree part of this behind an option, like bisect-ppx-report html --tree or similar. For small projects, the tree adds noise/confusion, especially if they have only one source directory. So, I think the PR should add the per-file statistics to all output, but format the output as a tree only for large projects, when asked to. If you'd like, I can help out with this.
Sure! I was thinking about it, and you could actually implement it as a theme. Then the markup would always be "tree-compatible" but depending on the theme you choose, you either see the "classic reports" or you get a report with collapsible directories. The disadvantage is that you would have to have 4 themes if you want (light / dark + classic / tree). The advantage is that there is no need to adapt the markup. On the other hand, programming in OCaml is nicer than programming in CSS.
Adapting the CSS to the dark theme (you can force generation with the dark theme with bisect-ppx-report html --theme dark, or set your browser's theme to dark).
Sure!
On the other hand, programming in OCaml is nicer than programming in CSS.
Indeed. It's probably best to actually emit different markup rather than do this with themes. Doing it with themes might get more and more difficult to maintain if the number of themes ever starts growing.
Here's an example of a larger report: https://arvidj.eu/_tezos_coverage.2022-02-04/
Here's an example of a larger report: https://arvidj.eu/_tezos_coverage.2022-02-04/
Thanks. It's pretty clear that this PR's kind of feature is useful :)
I've added the tree option and I've made an adaption for the dark theme.
What remains to do:
- clean up the history. any specific thoughts about this or do you think it could pass as a single commit PR?
No need to do this. I will squash this PR to one commit.
Okay, I think this is ready for review now. I've fixed the existing test (I only had to modify one cram test) and I added a cram test for the html-tree.
For the open/close buttons, I've added two easter eggs:
Could you please fix the numbers so that there aren't underscores in the middle?
Could you please fix the numbers so that there aren't underscores in the middle?
For sure, just did that. The reason I added it was to make large numbers a bit more readable, at the request of a pointy-haired boss hehe. An alternative would to use:
300 999/555 555
or 300.999/555.555
300,999/555,555
I'd prefer spaces in this case but I don't feel strongly about this (or the need to have any digit grouping whatsoever).
Part of the issue with these separators is they all either look strange (non-standard), or conflict with the various standard but local conventions for decimal and thousands delimiters, which differ from country to country. Given that Bisect is rarely run on files with thousands of instrumentation points, and even more rarely tens of thousands, but probably never millions, I think it's best to just not use separators. We can come back to this later, though, upon more feedback :)
Thank you for this PR!
This MR makes the
index.html
page in the generated documentation easier to read for larger projects:It adds:
I've built these three things on top of each other, so it'd be quite easy to cherry-pick parts of the proposal.
As it is, the MR is in a little bit of a mess, I'd like to check first if there is interest in such a proposal. Notably:
The last commit contains an example project (as in the image above), and a script for generating the report.
If you like it, I'll start cleaning up.