djlint / djLint

✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
https://djLint.com
GNU General Public License v3.0
686 stars 84 forks source link

[BUG] [Linter] `.djlintrc` not loading since 1.34.0 #767

Open yndajas opened 1 year ago

yndajas commented 1 year ago

System Info

Issue

After upgrading from 1.33.0 to 1.34.0, I now see this when running djLint:

Failed to load .djlintrc file. cannot access local variable 'content' where it is not associated with a value

It still lints, but I guess it's not loading config properly. I haven't looked at this commit in detail, but I guess it's related (since it changed config loading and was included in 1.34.0): https://github.com/Riverside-Healthcare/djLint/commit/d8a059ac32027c956fbae762ce6de44f5d47826c

How To Reproduce

I'm not too sure about a generic way to reproduce this, but the project I'm running it on is ministryofjustice/hmpps-accredited-programmes-ui. You could clone that, run script/setup and then djlint . or npm run lint

When running djLint, it will output the error mentioned above

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

{
  "extension": "njk",
  "profile": "nunjucks"
}
welcome[bot] commented 1 year ago

Thanks for opening your first issue here!

aslak01 commented 10 months ago

+1 on having this problem.

simplegr commented 10 months ago

here also!

christopherpickering commented 10 months ago

Thanks, I think someone has a pr that will fix this one. I should get it release shortly, sorry for the long out of office.

christopherpickering commented 10 months ago

:tada: This issue has been resolved in version 1.34.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: