Skip to content
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

native support lcov.info files #297

Merged
merged 2 commits into from
Nov 26, 2022
Merged

Conversation

peterg79
Copy link
Contributor

@peterg79 peterg79 commented Nov 24, 2022

Support lcov.info files, as described in https://ltp.sourceforge.net/coverage/lcov/geninfo.1.php

Potential future improvements: let users mix lcov.info and xml reports.

Copy link
Owner

@Bachmann1234 Bachmann1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! Thanks for this! It's a significant feature!

My only comment so far is id rather not break backwards compatibility.


The path strings may or may not exist.
"""
parser = argparse.ArgumentParser(description=DESCRIPTION)

parser.add_argument("coverage_xml", type=str, help=COVERAGE_XML_HELP, nargs="+")
parser.add_argument("coverage_file", type=str, help=COVERAGE_FILE_HELP, nargs="+")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer some attempt to preserve backwards compatibility.

Perhaps including the coverage xml file as an alternative argument but that does the same thing (if both are provided I'm fine with preferring coverage_file. Or maybe throw an error if both are provided?)

Renaming the arg everywhere else makes sense. I just would like the command line to support coverage_xml as an alternate form

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, I'll take care of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, can you please enable the workflows for this PR?

Copy link
Contributor Author

@peterg79 peterg79 Nov 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a bit confused. This line defines a positional argument (see ArgumentParser.add_argument), therefore nobody will call it with the argument name; it will only define the key in the resulting structure, which is only used internally.

Looking at test_diff_cover_tool.py#L9 shows that nothing changed about how to call the function, therefore there's no backward compatibility issue.

Can you please double-check if my understanding is correct?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you are right. Sorry. Misread the argparse code :-)

@Bachmann1234 Bachmann1234 merged commit 40c411d into Bachmann1234:main Nov 26, 2022
@Bachmann1234
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants