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] H026 False positive on data-id #711

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

[BUG] [Linter] H026 False positive on data-id #711

silverwind opened this issue Jul 9, 2023 · 2 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

H026 is likely only meant to match on id and class atttributes but matches on data-id as well which seems a unintended parser error.

How To Reproduce

<div data-id=""></div>

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
@christopherpickering
Copy link
Contributor

Yes thanks for catching. the regex \b and - combo will chase me forever lol.

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