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
settings djlint.configuration relative paths #128
Comments
This problem was caused by this change: #82. But we cannot just roll it back, because that would cause other problems. I propose you two solutions to this problem:
No, this option cannot be configured through the CLI, only through the config file. The list of available CLI options can be seen with the |
Thanks for reply - ad more CLI - my bad, you're right, now I get it. I'd love to stop using I have slightly complicated workspace (4 git repos in the main directory), but not sure what am I doing wrong. The Is there a way I can debug picking default config? It seem not to work even when I execute djlint manually, so perhaps I have some issue in my venv / path / something |
@vasekch is there any chance you make make a test repository I can see the problem in? Thanks! |
@christopherpickering it seems to be "above" git 🙂 I think I got to the bottom of in in this routine https://github.com/Riverside-Healthcare/djLint/blob/master/src/djlint/settings.py#L29 As I mentioned I have VSC workspace with 4 git repos and couple of them have django templates in them. When djlint is executed config path function On top of this I symlink the config file from the main dir into one of the repos. Schematically
So it seems that Maybe the project root path detection should consider I feel to small to have strong opinion here. Putting the config file in all django template repos would resolve the problem, but that's not dry enough. I'd love to use relative path in wokspace settings, but no big deal with the abolute path. As I'm thinking about it, our project setup may get improved if |
Yeah for this I honestly just used the same design as black and isort when looking for the project root. If you have a nice idea of how to use the venv path feel free to start a pr... if you didn't already.. just getting back in here. |
I have workspace open on a project folder e.g.
/home/foo/projectA/
I'm customizing djlint with my own config file in project folder
/home/foo/projectA/.djlintrc
I'm having template files in various subdirs e.g.
./templates/main.html
,./myapp/templates/page.html
Let me elaborate on various options in settings.json
It feels quite tricky to set this correctly, which seems to be absolute path for me (dislike).
It seems that cwd for djlint execution is path of a target file. For finding config file it may be beneficial to execute djlint from workspace base dir.
Ideally, would it be possible to pickup
.djlintrc
file in workspace base folder automatically by default?BTW: docs say:
But I'm only able to pass
djlint.configuration
argument, is it possible to pass for examplemax_line_length
or such?P.S.: Thanks for this extension, 💚!
The text was updated successfully, but these errors were encountered: