From 4e326ed13881f191bd7a22dc6a940a6866ceabe7 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 8 Jul 2016 19:57:30 +0000 Subject: [PATCH] Extract check_django_templates. --- tools/check-templates | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/check-templates b/tools/check-templates index c292710908..40186e7a95 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -180,9 +180,10 @@ def check_our_files(): for fn in templates: validate(fn) - # Django templates are pretty messy now, so we do minimal checking. templates = [fn for fn in git_files if fn.endswith('.html')] + check_django_templates(templates) +def check_django_templates(templates): def ok(fn): if 'templates' not in fn: return False if 'api.html' in fn: return False @@ -191,9 +192,9 @@ def check_our_files(): templates = sorted(list(filter(ok, templates))) - assert len(templates) >= 10 # sanity check that we are actually doing work for fn in templates: + # Many of our Django templates have broken indentation. validate(fn, check_indent=False) if __name__ == '__main__':