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

Modularization #225

Merged
merged 11 commits into from
Feb 19, 2018
Merged

Modularization #225

merged 11 commits into from
Feb 19, 2018

Conversation

latk
Copy link
Member

@latk latk commented Feb 18, 2018

This PR splits the gcovr script into multiple modules, as discussed in #215.

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
Copy link

codecov bot commented Feb 18, 2018

Codecov Report

Merging #225 into master will increase coverage by 0.29%.
The diff coverage is 80.46%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gcovr/__main__.py 88.46% <100%> (+7.59%) ⬆️
gcovr/coverage.py 100% <100%> (ø)
gcovr/version.py 100% <100%> (ø)
gcovr/tests/test_args.py 100% <100%> (ø) ⬆️
gcovr/summary_generator.py 37.5% <37.5%> (ø)
gcovr/utils.py 62.29% <62.29%> (ø)
gcovr/gcov.py 69.04% <69.04%> (ø)
gcovr/txt_generator.py 78.18% <78.18%> (ø)
gcovr/cobertura_xml_generator.py 89.05% <89.05%> (ø)
gcovr/html_generator.py 94.04% <94.04%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a77ff3...5196437. Read the comment docs.

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__
Copy link
Contributor

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__ ?

Copy link
Member Author

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 a gcovr.__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?

Copy link
Member Author

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.
@latk latk merged commit 5b0e68f into gcovr:master Feb 19, 2018
@latk latk deleted the modularization branch February 19, 2018 21:20
@latk latk removed the needs review label Mar 6, 2018
JamesReynolds pushed a commit to JamesReynolds/gcovr that referenced this pull request Mar 8, 2018
latk added a commit to latk/gcovr that referenced this pull request Mar 18, 2018
Modularization was implemented in gcovr#225
@latk latk mentioned this pull request Mar 18, 2018
latk added a commit to latk/gcovr that referenced this pull request Apr 6, 2018
- the driver/main was extracted in gcovr#214
- Modularization was implemented in gcovr#225
- bugfixes have been superseded on master branch
- "make clean" is useful but not strictly necessary
- Travis config was committed independently in 0afac3a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants