diff --git a/AUTHORS.txt b/AUTHORS.txt index 8a697a9..c1bf993 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -4,3 +4,4 @@ contributions by: Jessamyn Smith Simon Charette Pamela McA'Nulty +Emil Madsen diff --git a/django_coverage_plugin/plugin.py b/django_coverage_plugin/plugin.py index 4e424f5..661f4ac 100644 --- a/django_coverage_plugin/plugin.py +++ b/django_coverage_plugin/plugin.py @@ -6,6 +6,7 @@ from __future__ import print_function import os.path +import re from six.moves import range @@ -162,6 +163,15 @@ def file_tracer(self, filename): def file_reporter(self, filename): return FileReporter(filename) + def find_executable_files(self, src_dir): + for (dirpath, dirnames, filenames) in os.walk(src_dir): + for filename in filenames: + # We're only interested in files that look like reasonable HTML + # files: Must end with .htm or .html, and must not have certain + # funny characters that probably mean they are editor junk. + if re.match(r"^[^.#~!$@%^&*()+=,]+\.html?$", filename): + yield os.path.join(dirpath, filename) + # --- FileTracer methods def has_dynamic_source_filename(self):