Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Linter] Unclosed string found in template syntax #301

Closed
3 tasks done
jace opened this issue Jul 26, 2022 · 5 comments
Closed
3 tasks done

[BUG] [Linter] Unclosed string found in template syntax #301

jace opened this issue Jul 26, 2022 · 5 comments
Labels
🔍 linter 🦠 bug Something isn't working released

Comments

@jace
Copy link

jace commented Jul 26, 2022

System Info

  • OS: macOS 12.4
  • Python Version: 3.9.13
  • djLint Version: 1.7.2
  • template language: jinja

Issue

djLint is insisting the following two lines have unclosed strings in template syntax. I do not see any unclosed strings. The mixed use of single and double quotes is also because djLint confuses some of these to be HTML attributes and insists on double quotes.

How To Reproduce

{% macro rendersubmit(buttons=[], css_class="", tabindex='', cancel_url='', style="horiz", csrf_error=false) -%}{% endmacro %}

{%- macro renderform(form, formid, submit, ref_id="form", message='', action=None, cancel_url='', multipart=false, style="", autosave=false, draft_revision=none) %}{% endmacro %}
T027 1:0 Unclosed string found in template syntax. {% macro rendersubmi
T027 5:0 Unclosed string found in template syntax. {%- macro renderform
@jace jace added 🔍 linter 🦠 bug Something isn't working labels Jul 26, 2022
@christopherpickering
Copy link
Contributor

Hey @jace thanks. I can't reproduce it by copying what you have. Can you send a more complete file? There must be some leading text causing the issue.

image

@jace
Copy link
Author

jace commented Jul 26, 2022

The full file: https://github.com/hasgeek/funnel/blob/ef266faadd4c48ee6417c961651ec5cd391573e6/funnel/templates/forms.html.jinja2

@christopherpickering
Copy link
Contributor

My bad, I missed you were running w/ --profile=jinja. I get the message now 👍🏽

@christopherpickering
Copy link
Contributor

It does seem to be the mixed quotes causing a runnaway regex :) I will split up the regex and put a fix out soon. Thanks!

christopherpickering pushed a commit that referenced this issue Jul 26, 2022
## [1.7.4](v1.7.3...v1.7.4) (2022-07-26)

### Bug Fixes

* **linter:** fixed false positive on T027 ([946b8ad](946b8ad)), closes [#301](#301)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.7.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 linter 🦠 bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants