fix(t027): fixed test and regression in T027

closes #141
This commit is contained in:
Christopher Pickering 2022-07-29 07:37:21 -05:00
parent ca7ff3a1c7
commit 6f84539038
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
2 changed files with 3 additions and 9 deletions

View file

@ -210,15 +210,9 @@
- "{{((?:(?!\"|}}).)*?(\")(?:(?!\\2|}}).)*?\\2(?:(?!\\2|}}).)*?)*\\2(?:(?!\\2|}}).)*?}}"
# for tags with a single quote
# for double quotes
- "{%((?:(?!\"|%}).)*?(\")(?:(?!\\2|%}).)*?)%}"
# for single quotes
- "{%((?:(?!'|%}).)*?(')(?:(?!\\2|%}).)*?)%}"
- "{%((?:(?!'|\"|%}).)*?('|\")(?:(?!\\2|%}).)*?)%}"
- "{{((?:(?!'|\"|}}).)*?('|\")(?:(?!\\2|}}).)*?)}}"
# for double quotes
- "{{((?:(?!\"|}}).)*?(\")(?:(?!\\2|}}).)*?)}}"
# for single quotes
- "{{((?:(?!'|}}).)*?(')(?:(?!\\2|}}).)*?)}}"
- rule:
name: T028
message: Consider using spaceless tags inside attribute values. {%- if/for -%}

View file

@ -590,7 +590,7 @@ def test_T027(runner: CliRunner, tmp_file: TextIO) -> None:
tmp_file.name,
b'{% trans "Check box if you\'re interested in this location." %}',
)
result = runner.invoke(djlint, [tmp_file.name])
result = runner.invoke(djlint, [tmp_file.name, "--profile", "django"])
assert "T027" not in result.output
# test mixed quotes