Extract check_handlebar_templates.

This commit is contained in:
Steve Howell 2016-07-08 20:11:05 +00:00 committed by Tim Abbott
parent 4e326ed138
commit 1006b95898
1 changed files with 8 additions and 5 deletions

View File

@ -174,15 +174,18 @@ def check_our_files():
git_files = [line.strip() for line in subprocess.check_output(['git', 'ls-files'],
universal_newlines=True).split('\n')]
# Check all our handlebars templates.
templates = [fn for fn in git_files if fn.endswith('.handlebars')]
assert len(templates) >= 10 # sanity check that we are actually doing work
for fn in templates:
validate(fn)
check_handlebar_templates(git_files)
templates = [fn for fn in git_files if fn.endswith('.html')]
check_django_templates(templates)
def check_handlebar_templates(templates):
# Check all our handlebars templates.
templates = [fn for fn in templates if fn.endswith('.handlebars')]
assert len(templates) >= 10 # sanity check that we are actually doing work
for fn in templates:
validate(fn, check_indent=True)
def check_django_templates(templates):
def ok(fn):
if 'templates' not in fn: return False