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.

latk added 9 commits Feb 18, 2018
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 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

@mayeut mayeut Feb 18, 2018

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

@latk latk Feb 18, 2018

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

@latk latk Feb 18, 2018

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.

latk added 2 commits Feb 18, 2018
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 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
@latk latk deleted the modularization branch Feb 19, 2018
@latk latk removed the needs review label Mar 6, 2018
JamesReynolds pushed a commit to JamesReynolds/gcovr that referenced this issue Mar 8, 2018
latk pushed a commit to latk/gcovr that referenced this issue Mar 18, 2018
Modularization was implemented in gcovr#225
@latk latk mentioned this pull request Mar 18, 2018
latk pushed a commit to latk/gcovr that referenced this issue 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants