-
Notifications
You must be signed in to change notification settings - Fork 265
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
Modularization #225
Modularization #225
Conversation
This required the options.show_branch flag to be extracted. It was previously used as a global variable to control the mode of `CoverageData.coverage()`.
the `CoverageData.summary()` method was removed and put into `print_text_report()` as it is mostly presentational.
Codecov Report
@@ Coverage Diff @@
## master #225 +/- ##
==========================================
+ Coverage 83.87% 84.17% +0.29%
==========================================
Files 3 11 +8
Lines 1228 1251 +23
Branches 248 248
==========================================
+ Hits 1030 1053 +23
Misses 138 138
Partials 60 60
Continue to review full report at Codecov.
|
gcovr/__main__.py
Outdated
xrange = range | ||
from .gcov import get_datafiles, process_existing_gcov_file, process_datafile | ||
from .utils import get_global_stats, build_filter | ||
from .version import __version__, version_str # noqa: F401 unused __version__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why import __version__
that requires # noqa: F401 unused __version__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 hmm, good question. I just cargo-culted the existing code here because I'm not 100% sure about the Python conventions in this case. I see two alternatives:
- import the version in the
__init__
so that we have agcovr.__version__
attribute. - leave the version in the
gcovr.version
module until we offer an API that would profit from a version attribute.
What do you think would be best?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I'll keep __version__
but remove the version_str()
function which no longer adds any value over accessing the __version__
directly.
This function previously included the SVN revision number in the output, but that is no longer useful since gcovr is maintained in a Git repository. So instead, we can use `__version__` directly.
Modularization was implemented in gcovr#225
This PR splits the gcovr script into multiple modules, as discussed in #215.