Bachmann1234 / diff_cover

Automatically find diff lines that need test coverage.
Apache License 2.0
713 stars 191 forks source link

Added option to specify diff file location #410

Closed Jsostmann closed 5 months ago

Jsostmann commented 5 months ago

Added a flag to accept a path which points to a file containing the output of git diff

ex: diff-cover coverage_folder/coverage.xml --html-report report.html --diff-file=diff.txt

Bachmann1234 commented 5 months ago

Neat, thanks for the PR.

to merge this ill. need tests.

I also think the file tool is strongly dependent on the diff format diff-cover uses. So some documentation on how to generate the diff file in the readme would be nice.

Jsostmann commented 5 months ago

No problem. And okay sure thing. I'll add some tests / documentation and update the PR.

Thanks for the quick reply!

Jsostmann commented 5 months ago

@Bachmann1234 Have added documentation and 4 UT for the diff file tool

Bachmann1234 commented 5 months ago

@Jsostmann looks like you just have to run black over the pr to format things. Then this is looking good!

Thanks!

Jsostmann commented 5 months ago

@Jsostmann looks like you just have to run black over the pr to format things. Then this is looking good!

Thanks!

Awesome! and Thanks I'll go ahead and reformat using black.

Bachmann1234 commented 5 months ago

Ah jeez. My bad. I forgot to mention isort which formats the imports

Jsostmann commented 5 months ago

Ah jeez. My bad. I forgot to mention isort which formats the imports

Haha no worries! I should've caught that also. I didn't run verify.sh before pushing

Bachmann1234 commented 5 months ago

Awesome. Build is passing I should be able to get this merged and released soon. Hoping for tonight

Jsostmann commented 5 months ago

Awesome. Build is passing I should be able to get this merged and released soon. Hoping for tonight

Great! No rush, I appreciate the help!

vser1 commented 5 months ago

Thanks a lot @Jsostmann for the feature and @Bachmann1234 for your great work on this most helpful project! This PR should close #26 , #150 , and possibly #16 (with some additional client-side work). Looking forward for a 9.1.0! :tada:

Bachmann1234 commented 5 months ago

Alrighty, lets get this merged. Thanks for the PR @Jsostmann !

Bachmann1234 commented 5 months ago

Check out version 9.1.0! https://pypi.org/project/diff-cover/9.1.0/

thanks again

Jsostmann commented 5 months ago

Thanks a lot @Jsostmann for the feature and @Bachmann1234 for your great work on this most helpful project!

This PR should close #26 , #150 , and possibly #16 (with some additional client-side work). Looking forward for a 9.1.0! :tada:

Sure thing! Hope it helps!

Jsostmann commented 5 months ago

Alrighty, lets get this merged. Thanks for the PR @Jsostmann !

Awesome! Sure thing!

chkch commented 4 months ago

@Jsostmann May I ask if there is validation for diff file=diff. txt to support Jacoco generated XML full coverage reports? I recently encountered an issue while generating incremental reports based on multiple XML full coverage reports in a Java project. The execution steps are as follows: git diff master test > diff.txt diff-cover report_*.xml --diff-file=diff.txt Prompt me: No lines with coverage information in this diff

Jsostmann commented 4 months ago

Hey @chkch did you check to make sure that the diff file you created had any changes?