-
-
Notifications
You must be signed in to change notification settings - Fork 84
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] Can't ignore H006 #333
Comments
Hi, Can you provide some of the code? I'm unable to reproduce with this example: {# djlint:off H006 #}
<img />
{# djlint:on #} H006 is ignored in the output: H013 2:0 Img tag should have an alt attribute. <img />
Linted 1 file, found 1 error. Or w/ a repos:
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.9.5
hooks:
- id: djlint-django
args: [-i, H006] and a simple html file: <img /> git add .
pre-commit run --all-files Does not return H006: index.html
H013 1:0 Img tag should have an alt attribute. <img />
Linted 1 file, found 1 error. |
Thanks for the reply. I'm not able to get the same results on your very first example:
My test is generating a project with |
Thanks, can you give me the exact steps you follow from scratch to reproduce it? |
Sure,
|
@aleprovencio I've copied your steps and still cannot reproduce it - I swapped the fish command for the one working on Mac, and used Nano instead of nvim. Here's some pics w/ the long pip logs removed: |
Fyi, I'm finally able to reproduce on a windows machine. I'll dig into it more, I wonder if it in a way the regex is being handled. |
Upgrading from djlint-1.3.0 to 1.11.0 fixed the problem on windows. Can you test out a |
Just tested it out. Although specifying lint error like this, is still not working:
...this code already works as expected:
So I guess you're on track 😃 |
Ok cool thanks! This is getting close. Do you have djlint in the .venv still? In the env/lib(?)/site-packages/djlint/helpers.py, can you add two print statements for me, and then run again?
rule should be "H006" Otherwise, when you have time you can go on the discord and we can do a screen share on there to debug. |
Hey!
The additional printed text is:
Note that finding However, does this output mean that |
Following your suggestions of #344: Applying the additional
And
|
It means that T003 was found, and H006 is what you were trying to ignore. I think I have a fix on the way, thanks! |
# [1.12.0](v1.11.1...v1.12.0) (2022-08-24) ### Bug Fixes * **h006:** prevented false positives on H006 ([215bd23](215bd23)), closes [#344](#344) [#333](#333) * **h012:** prevent H012 from matching the contents of tags or attributes ([4480cff](4480cff)), closes [#348](#348) * **t001:** fixed false positive on multiline template tags ([ea76672](ea76672)), closes [#350](#350) ### Features * **h021:** allow inline styles that contain template syntax ([f1a39ed](f1a39ed)), closes [#351](#351) * **t002:** allow variables names to be used in the {% extends tag ([a5d96e7](a5d96e7)), closes [#349](#349)
🎉 This issue has been resolved in version 1.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you @christopherpickering ! |
No prob, thank you! |
System Info
3.10.6
)1.9.4
)Issue
I'm not able to ignore
H006
('img tag should have height and width attributes.').How To Reproduce
On
pre-commit
config useargs: ["-i H006"]
or use one of the methods provided on documentationThe text was updated successfully, but these errors were encountered: