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

Conversation

Projects
None yet
2 participants
@latk
Copy link
Member

commented Feb 18, 2018

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

latk added some commits Feb 18, 2018

modularization: extract utils
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()`.
modularization: extract CoverageData
the `CoverageData.summary()` method was removed and put into
`print_text_report()` as it is mostly presentational.
@codecov

This comment has been minimized.

Copy link

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__

This comment has been minimized.

Copy link
@mayeut

mayeut Feb 18, 2018

Contributor

Why import __version__ that requires # noqa: F401 unused __version__ ?

This comment has been minimized.

Copy link
@latk

latk Feb 18, 2018

Author Member

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

This comment has been minimized.

Copy link
@latk

latk Feb 18, 2018

Author Member

On second thought, I'll keep __version__ but remove the version_str() function which no longer adds any value over accessing the __version__ directly.

latk added some commits Feb 18, 2018

remove version_str() function
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 force-pushed the latk:modularization branch from 3a40043 to 5196437 Feb 18, 2018

@mayeut

mayeut approved these changes Feb 18, 2018

@latk latk merged commit 5b0e68f into gcovr:master Feb 19, 2018

3 of 4 checks passed

codecov/patch 80.46% of diff hit (target 83.87%)
Details
codecov/project 84.17% (+0.29%) compared to 8a77ff3
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@latk latk deleted the latk:modularization branch Feb 19, 2018

@latk latk referenced this pull request Mar 5, 2018

Closed

Split main script into a module #54

@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

partial feature parity with dev branch
Modularization was implemented in gcovr#225

@latk latk referenced this pull request Mar 18, 2018

Merged

Close the dev branch #246

latk added a commit to latk/gcovr that referenced this pull request Apr 6, 2018

feature parity with dev branch
- 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
You can’t perform that action at this time.