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] rule H021 (inline styles) broken for multiline tags #678

Closed
3 tasks done
kleins05 opened this issue Jun 1, 2023 · 2 comments
Closed
3 tasks done
Labels
🔍 linter 🦠 bug Something isn't working released

Comments

@kleins05
Copy link

kleins05 commented Jun 1, 2023

System Info

  • OS: mac OS 10.13
  • Python Version: 3.11.2
  • djLint Version: 1.30.0
  • template language: django

Issue

If a tag with a style attribute spans multiple lines, rule H021 does not detect the inline style.

Example:

<div style="color:green"
     class="foo">
</div>

Same example with the whole div tag in one line works.

How To Reproduce

  1. Create a template file test.html with the above example. djlint test.html lints successfully. Should fail.
  2. Place the whole opening tag into one line (move the class attribute). djlint test.html fails with rule H021. Correct

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

ignore = "H017,H031"
indent = 2
quiet = true

@kleins05 kleins05 added 🔍 linter 🦠 bug Something isn't working labels Jun 1, 2023
@welcome
Copy link

welcome bot commented Jun 1, 2023

Thanks for opening your first issue here!

christopherpickering pushed a commit that referenced this issue Jun 2, 2023
## [1.30.1](v1.30.0...v1.30.1) (2023-06-02)

### Bug Fixes

* **linter:** added missing positive on H021 ([221c31f](221c31f)), closes [#678](#678)
* **linter:** fixed false positive on H037 ([3b2e522](3b2e522)), closes [#679](#679)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.30.1 🎉

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