Skip to content

Commit

Permalink
fix(t027): fixed test and regression in T027
Browse files Browse the repository at this point in the history
closes #141
  • Loading branch information
Christopher Pickering committed Jul 29, 2022
1 parent ca7ff3a commit 6f84539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/djlint/rules.yaml
Expand Up @@ -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 -%}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_linter/test_linter.py
Expand Up @@ -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
Expand Down

0 comments on commit 6f84539

Please sign in to comment.