-
Notifications
You must be signed in to change notification settings - Fork 74
chore: use trim_blocks and lstrip_blocks for jinja templates #838
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #838 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 27 +1
Lines 1608 1653 +45
Branches 328 337 +9
=========================================
+ Hits 1608 1653 +45
Continue to review full report at Codecov.
|
|
How's the result? |
|
@software-dov Still working out issues in a few places (hence the failing tests :)), but I think this should result in fewer instances of manual whitespace trimming |
|
More power to you for doing this. I remember having screaming fits when I first tried to make vaguely-python-whitespace templates. |
|
Will get #774 over the line first and then merge this, since I suspect there will be merge conflicts otherwise. |
264ca2d to
9d0d188
Compare
Enable
trim_blocksandlstrip_blocksin the Jinja environment to make it easier to manage whitespace and newlines. This PR may result in slight changes to the formatting of generated code.https://jinja.palletsprojects.com/en/2.11.x/api/#jinja2.Environment
https://jinja.palletsprojects.com/en/2.11.x/templates/#whitespace-control