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] T027 False positive with golang comment syntax #712

Closed
3 tasks done
silverwind opened this issue Jul 9, 2023 · 3 comments
Closed
3 tasks done

[BUG] [Linter] T027 False positive with golang comment syntax #712

silverwind opened this issue Jul 9, 2023 · 3 comments
Labels
🔍 linter 🦠 bug Something isn't working released

Comments

@silverwind
Copy link

silverwind commented Jul 9, 2023

System Info

  • OS: macOS 15
  • Python Version: 3.11
  • djLint Version: 1.31.1
  • template language: golang

Issue

T027 likely shouldn't parse inside go template comments as it's picking up a ' as a unbalanced string while this is purely comment text.

How To Reproduce

{{/* can't */}}

Contents of .djlintrc/pyproject.toml [tool.djlint]

[tool.djlint]
profile="golang"
@silverwind silverwind added 🔍 linter 🦠 bug Something isn't working labels Jul 9, 2023
6543 pushed a commit to go-gitea/gitea that referenced this issue Jul 9, 2023
Enable these rules:

- H014 | More than 2 blank lines.
- H023 | Do not use entity references.

There are more potential rules to enable but they are blocked by bugs in
the linter:

- djlint/djLint#711
- djlint/djLint#712
@silverwind silverwind changed the title [BUG] [Linter] T027 False-Positive with golang comment syntax [BUG] [Linter] T027 False positive with golang comment syntax Jul 10, 2023
@christopherpickering
Copy link
Contributor

@silverwind thanks for using djlint.

@silverwind
Copy link
Author

silverwind commented Jul 17, 2023

Thanks for your work as well! If I had more time available, I'd certainly want to contribute here.

christopherpickering pushed a commit that referenced this issue Jul 19, 2023
# [1.32.0](v1.31.1...v1.32.0) (2023-07-19)

### Bug Fixes

* **formatter:** fixed formatting on chained function ([7c2756d](7c2756d)), closes [#704](#704)
* **linter:** fixed false positive on h026 data-id ([400882a](400882a)), closes [#711](#711)
* **linter:** fixed golang false positive on T027 ([232f4bc](232f4bc)), closes [#712](#712)

### Features

* **formatter:** added support for jazzband's sorl-thumbnail tags ([86122dc](86122dc)), closes [#714](#714)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

silverwind added a commit to go-gitea/gitea that referenced this issue Jul 19, 2023
New rules enabled as the bugs I reported were fixed:

- H026 | Empty id and class tags can be removed.
- T027 | Unclosed string found in template syntax.

Refs:

djlint/djLint#711
djlint/djLint#712
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