Commit c773e45b by Calen Pennington Committed by GitHub

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

Teach the mako template linter to understand django-format comments
parents 6c9b38dc f6b061c7
...@@ -578,6 +578,7 @@ class TestMakoTemplateLinter(TestLinter): ...@@ -578,6 +578,7 @@ class TestMakoTemplateLinter(TestLinter):
@data( @data(
{'template': '{% extends "wiki/base.html" %}'}, {'template': '{% extends "wiki/base.html" %}'},
{'template': '{{ message }}'}, {'template': '{{ message }}'},
{'template': '{# comment #}'},
) )
def test_check_mako_on_django_template(self, data): def test_check_mako_on_django_template(self, data):
""" """
......
...@@ -2003,7 +2003,7 @@ class MakoTemplateLinter(BaseLinter): ...@@ -2003,7 +2003,7 @@ class MakoTemplateLinter(BaseLinter):
True if this is really a Django template, and False otherwise. 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 True
return False return False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment