djLint
djLint copied to clipboard
[BUG] [Linter] `.djlintrc` not loading since 1.34.0
- [x] I'm on the latest version of djLint
- [x] I've searched the issues
- [x] I've read the docs
System Info
- OS: macOS Ventura 13.5.2
- Python Version: 3.11.5 (
python3
) - djLint Version: 1.34.0
- template language: Nunjucks
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"
}
Thanks for opening your first issue here!
+1 on having this problem.
here also!
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.
:tada: This issue has been resolved in version 1.34.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket: