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] H007 (missing DOCTYPE) doesn't trigger after {% load static %} #1010

Open
3 tasks done
graingert-coef opened this issue Nov 7, 2024 · 0 comments
Open
3 tasks done
Labels
🔍 linter 🦠 bug Something isn't working

Comments

@graingert-coef
Copy link

System Info

  • OS: Mac OS
  • Python Version 3.12.7
  • djLint Version 1.36.1
  • template language: e.g. django 4.2 (LTS)

Issue

when linting:

{% load static %}
<html></html>

djlint doesn't say to add the missing doctype

How To Reproduce

 thomas@Thomass-MacBook-Pro  ~/projects  cat demo.html
{% load static %}
<html></html>
 thomas@Thomass-MacBook-Pro  ~/projects  pipx run djlint --profile=django --include=H007 demo.html

Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00


Users/thomas/projects/demo.html
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
H005 2:0 Html tag should have lang attribute. <html></html>
H016 2:0 Missing title tag in html. <html></html>
H020 2:0 Empty tag pair found. Consider removing. <html></html>
H030 2:0 Consider adding a meta description. <html></html>
H031 2:0 Consider adding meta keywords. <html></html>

Linted 1 file, found 5 errors.

 ✘  thomas@Thomass-MacBook-Pro  ~/projects  vim demo.html
 thomas@Thomass-MacBook-Pro  ~/projects  cat demo.html
<html></html>
 thomas@Thomass-MacBook-Pro  ~/projects  pipx run djlint --profile=django --include=H007 demo.html

Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00


Users/thomas/projects/demo.html
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
H005 1:0 Html tag should have lang attribute. <html></html>
H007 1:0 <!DOCTYPE ... > should be present before the html tag. <html
H016 1:0 Missing title tag in html. <html></html>
H020 1:0 Empty tag pair found. Consider removing. <html></html>
H030 1:0 Consider adding a meta description. <html></html>
H031 1:0 Consider adding meta keywords. <html></html>

Linted 1 file, found 6 errors.

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

empty

@graingert-coef graingert-coef added 🔍 linter 🦠 bug Something isn't working labels Nov 7, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant