Skip to content

Commit fa2c606

Browse files
author
Pamela McA'Nulty
authored
Merge pull request #39 from Skeen/master
Initial attempt at finding unexecuted files
2 parents 8d66fbf + a9d274b commit fa2c606

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ contributions by:
44
Jessamyn Smith
55
Simon Charette
66
Pamela McA'Nulty
7+
Emil Madsen

django_coverage_plugin/plugin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from __future__ import print_function
77

88
import os.path
9+
import re
910

1011
from six.moves import range
1112

@@ -162,6 +163,15 @@ def file_tracer(self, filename):
162163
def file_reporter(self, filename):
163164
return FileReporter(filename)
164165

166+
def find_executable_files(self, src_dir):
167+
for (dirpath, dirnames, filenames) in os.walk(src_dir):
168+
for filename in filenames:
169+
# We're only interested in files that look like reasonable HTML
170+
# files: Must end with .htm or .html, and must not have certain
171+
# funny characters that probably mean they are editor junk.
172+
if re.match(r"^[^.#~!$@%^&*()+=,]+\.html?$", filename):
173+
yield os.path.join(dirpath, filename)
174+
165175
# --- FileTracer methods
166176

167177
def has_dynamic_source_filename(self):

0 commit comments

Comments
 (0)