Autoformatting django templates

Answered

I am using https://confluence.jetbrains.com/display/IDEADEV/Command-Line+Source+Code+Formatter to format code using CLI.

When I edit the code in pyCharm, I select Django in https://www.jetbrains.com/help/pycharm/2017.1/python-template-languages.html and it works correctly.

However the CLI command doesn't have this option. Is there a way to run the formatting using the django template formatting?

0
2 comments

Unfortunately, as far as I see, this functionality relies on the options included in a code style scheme and it indeed doesn't contain any information about the template language of choice. Note that, in general, to function properly the built-in formatter also needs to know the project's layout and where template directories are to distinguish between normal HTML files and those containing templates, and the latter information is also omitted from the exported settings.

Could you please create an issue in our tracker, and we will try to think of some way to extend this CLI for template languages?

0
Avatar
Permanently deleted user

Thank you for your response. I have created an issue. https://youtrack.jetbrains.com/issue/PY-23835. I do not currently own PyCharm but if that issue is resolved, I will most likely purchase it. It's a really good formatter and I didn't find anything else out there which does the job.

0

Please sign in to leave a comment.