aantron / bisect_ppx

Code coverage for OCaml and ReScript
http://aantron.github.io/bisect_ppx/demo/
MIT License
302 stars 60 forks source link

bisect-ppx-report clean command for deleting .coverage files and _coverage/ #368

Closed aantron closed 2 years ago

aantron commented 3 years ago

...this command should find all the same files that, say, bisect-ppx-report html would find, and delete them, so that users don't have to come up over and over with commands for doing it.

vch9 commented 2 years ago

This would be cool! Did you also have in mind to clean the reports?

aantron commented 2 years ago

That could be done if the same output flags are provided.

I've been leaning towards just closing this issue, as there has been no "natural" demand for this to date, and I'm personally still getting by fine with manual deletion commands.

However, if you have a need for this or it would actually be convenient, please let me know.

vch9 commented 2 years ago

However, if you have a need for this or it would actually be convenient, please let me know.

I would not say we have a need for this, as you said, it's fine using manual deletion commands. With #389, we end up having multiple coverage files to remove, this action is also repeated in the make clean. bisect-ppx-report clean would cleaner and more straightforward.

aantron commented 2 years ago

I'm trying to compare the convenience of this to the "magic" of it, a command that mysteriously decides which files to remove and removes them. .coverage files and reporter output can be spread over many different locations, and bisect-ppx-report needs flags to find them in many cases. So to fully use a bisect-ppx-report clean command, one would still have to build a command line for it in the general case, and then it might delete surprising files. This is very different from, say, dune clean, which basically just deletes _build.

vch9 commented 2 years ago

This is not ideal yes, FYI we have in our project:

.PHONY: coverage-clean
coverage-clean:
    @-rm -Rf ${COVERAGE_OUTPUT}/*.coverage ${COVERAGE_REPORT}

Having a general clean could lead to deleting surprising files as you said. Maybe cleaning coverage files in BISECT_FILE and reports in (I don't know: BISECT_REPORT) could be interesting but this would require users to use these two environment variables.

aantron commented 2 years ago

Thanks.

I'm going to close this issue for now, as, to summarize, I don't see a way to solve it that is easy to use (easier than rm) and not fragile.