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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with overwriting files since 1.0.6 caused by problem with gitignore parsing #18
Comments
Hi. I have not been able to reproduce this problem. I see 2 ways out of this situation:
If you have any ideas about this, I'd be happy to hear it. |
Alright I dug a bit deeper and figured it out, it is actually a djlint bug, and not a bug in the extension. It's caused by using the stdin as input combined with the gitignore. On my (mac) machine, djlint puts the temp file here:
It then wrongly checks the path of its own temp file against the gitignore, which in my case matches because of the This didn't happen before 91699a6 because it was then using the filename instead of stdin - going back to that might be a fast way to fix it, but I'll also report this to djlint |
Makes sense! I think if djlint agree with me that when using stdin the gitignore should always be set to false (why give it the content of a file that should be ignored), then this problem will go away on its own I reported it here: djlint/djLint#224 |
With the djLint 1.0.0 update, is everything working as it should now? |
Closing the issue now. If the issue remains, let me know and I will reopen it. |
Hi!
I just noticed today that formatting any django html file with the djlint extension results in the file getting overwritten with "No files to check! 馃槩", on version 1.0.7.
If I roll back to 1.0.6 this still happens, but on 1.0.5 it doesn't.
I've reinstalled vscode and removed global settings, as well as resetting any workspace-specific settings.
After a bit of investigating, I found that it's caused, somehow, by the project's gitignore file - it was ignoring folders named
var/
, and that causes the extension to not find any files anymore. To be clear, it's unrelated to the filename - any file in any folder within the project causes the error.Note that this doesn't seem to be caused by djlint itself - if i manually run
djlint --use-gitignore <file>
it works correctly, even with thevar/
in the gitignore, only ignoring the file and producing the message if the path to the file is actually included in the gitignore.To reproduce
[tool.djlint]
anduse_gitignore = true
.gitignore
with justvar/
The text was updated successfully, but these errors were encountered: