-
Notifications
You must be signed in to change notification settings - Fork 25
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
Would auto-formatting / auto-indentation make sense for this project? #19
Comments
Whether or not this feature makes sense, this project is excellent - thank you so much! It just found a couple of bugs in Datasette. simonw/datasette@d0c752d |
Hey @simonw, well I’m glad you’re finding it helpful! 🙂 99% of the credit for those two issues should go to https://github.com/motet-a/jinjalint, from which most of Curlylint’s parser comes from (I’ve only changed the parser for a few bug fixes so far). For auto-formatting – this is something I’m personally very interested in as well, as a heavy user of both Prettier and black. I’ve been keen to work on this for a while, but need to be realistic with the time commitment something like this would take, so the short answer is "not for now", I think. The long answer is that there is some interest in making this happen in the Prettier world, and to me it feels like a good ecosystem for this to be done within, since there is so much similarity between all the curly template languages. So far the most promising attempt there is https://github.com/trivago/prettier-plugin-twig-melody, and I’m hoping this will be something we can leverage for Jinja / Django templates. For Curlylint, I can see a few ways for this project to help make auto-formatting happen:
If you or anyone else wants to help with this, I can see a few options:
|
I'm also interested in the jinja2, django template formatter. It seems that there is a package called "vsot", but unfortunately it is not maintained.
(Something, if it would be helpful.) Of course, if there is a dedicated plugin for prettier, I'm sure that's fine. |
Now that looks promising! |
Ah that’s really interesting, thank you for sharing it here. There aren’t that many parsers out there for HTML + template syntax, particularly with enough information for pretty-printing, so it’s always interesting to compare options at the very least. |
@thibaudcolas I recently discovered a tool called djhtml. It appears to be actively being developed now.
Currently, the feature seems to be only for indent adjustment, but we can expect more in the future. |
@yaegassy 🤘 that seems pretty promising, thank you for sharing. I’ll have to try that out myself. |
I've been hoping to find a templating equivalent of Black for quite a while. Could automatic formatting fit this project?
The text was updated successfully, but these errors were encountered: