summaryrefslogtreecommitdiff
path: root/coverage/html.py
diff options
context:
space:
mode:
authorloic@dachary.org <loic@dachary.org>2016-12-18 17:24:37 +0100
committerloic@dachary.org <loic@dachary.org>2016-12-18 17:24:37 +0100
commitc863b83d505397c1af74c152f4f3900c80877073 (patch)
treed0f864a3772618a9753bf5316d4a7792e8035c4c /coverage/html.py
parent878363970556406d1eed322f6bd8747af1145462 (diff)
downloadpython-coveragepy-git-c863b83d505397c1af74c152f4f3900c80877073.tar.gz
implement --skip-covered for html report #433
close #433 --HG-- branch : issue-433-2
Diffstat (limited to 'coverage/html.py')
-rw-r--r--coverage/html.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/coverage/html.py b/coverage/html.py
index 14771dd2..22783ef7 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -171,6 +171,15 @@ class HtmlReporter(Reporter):
def html_file(self, fr, analysis):
"""Generate an HTML file for one source file."""
+ # Get the numbers for this file.
+ nums = analysis.numbers
+ if self.config.skip_covered:
+ # Don't report on 100% files.
+ no_missing_lines = (nums.n_missing == 0)
+ no_missing_branches = (nums.n_partial_branches == 0)
+ if no_missing_lines and no_missing_branches:
+ return
+
source = fr.source()
# Find out if the file on disk is already correct.
@@ -184,9 +193,6 @@ class HtmlReporter(Reporter):
self.status.set_file_hash(rootname, this_hash)
- # Get the numbers for this file.
- nums = analysis.numbers
-
if self.has_arcs:
missing_branch_arcs = analysis.missing_branch_arcs()
arcs_executed = analysis.arcs_executed()