Merge pull request #15879 from edx/ret/mako-template-comments

Teach the mako template linter to understand django-format comments
This commit is contained in:
Calen Pennington
2017-08-23 14:34:32 -04:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -578,6 +578,7 @@ class TestMakoTemplateLinter(TestLinter):
@data(
{'template': '{% extends "wiki/base.html" %}'},
{'template': '{{ message }}'},
{'template': '{# comment #}'},
)
def test_check_mako_on_django_template(self, data):
"""

View File

@@ -2003,7 +2003,7 @@ class MakoTemplateLinter(BaseLinter):
True if this is really a Django template, and False otherwise.
"""
if re.search('({%.*%})|({{.*}})', mako_template) is not None:
if re.search('({%.*%})|({{.*}})|({#.*#})', mako_template) is not None:
return True
return False