diff --git a/src/djlint/rules.yaml b/src/djlint/rules.yaml index fa4398d..9638a29 100644 --- a/src/djlint/rules.yaml +++ b/src/djlint/rules.yaml @@ -242,8 +242,8 @@ name: T032 message: Extra whitespace found in template tags. patterns: - - "{%(([\"|'](?:(?!'|\"|%}).)*?[\"|'])|[^(?:%}|'|\")])*?\\s{2,}" - - "{{(([\"|'](?:(?!'|\"|}}).)*?[\"|'])|[^(?:}}|'|\")])*?\\s{2,}" + - "{%(([\"|'](?:(?!'|\"|%}).)*?[\"|'])|[^(?:%}|'|\"|\n)])*?[ \t]{2,}" + - "{{(([\"|'](?:(?!'|\"|}}).)*?[\"|'])|[^(?:}}|'|\"|\n)])*?[ \t]{2,}" - rule: name: H033 message: Extra whitespace found in form action. diff --git a/tests/test_linter/test_linter.py b/tests/test_linter/test_linter.py index daf0a6f..83f25cf 100644 --- a/tests/test_linter/test_linter.py +++ b/tests/test_linter/test_linter.py @@ -715,6 +715,24 @@ def test_T032(runner: CliRunner, tmp_file: TextIO) -> None: result = runner.invoke(djlint, [tmp_file.name, "--profile", "django"]) assert "T032" not in result.output + write_to_file( + tmp_file.name, + b"""{# [INFO] Simple example #} + {% set kira = [ + 'Goddess', 'Genius' + ] %} + + {# [INFO] Real example #} + {% set kira_online_scaners = [ + ('https://quttera.com/sitescan/', 'SashaButtonLightSkyBlue', 'Quttera'), + ('https://sitecheck.sucuri.net/results/', 'SashaButtonLimeGreen', 'Sucuri'), + ('https://www.isithacked.com/check/', 'SashaButtonPlum', 'Is It Hacked?'), + ] %} +""", + ) + result = runner.invoke(djlint, [tmp_file.name, "--profile", "jinja"]) + assert "T032" not in result.output + def test_H033(runner: CliRunner, tmp_file: TextIO) -> None: write_to_file(