You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just saw a .pre-commit-config.yaml created by the PPT that had irregular amounts (and in places fairly excessive) new lines between sections, presumably from conditional parts of the jinja template.
It's a very low priority issue, but fixing the spacing would create a more professional and polished output.
When someone is fixing the spacing commands here, it would be good to create a small section in the docs explaining how to properly format spacing notation for jinja, so future contributors can easily reference this.
The text was updated successfully, but these errors were encountered:
I've spent some time in the past looking into jinja spacing issues and am aware of the - "flag" to instruct jinja to remove whitespace before or after as in {%- if %} - where jinja will remove the line and any preceding white space.
I also made use of this tool: http://jinja.quantprogramming.com/ to rapidly change variables to see how the formatting was affected. It feels a bit like Tower of Hanoi trying to test all the different combinations. And the conclusion that I've drawn is that maybe the way we use jinja right now, we can't get the spacing to be consistent in the way that we want.
My "there, I fixed it" approach is to remove the blank line between each of the sections of the pre-commit.yml file. Everything is squished together and legibility suffers for sure, but the spacing is consistent! We could also add an extra blank comment before each section to provide a little bit of visual distinction.
All that being said, if someone knows the right way to do this, I'm all ears!
I just saw a
.pre-commit-config.yaml
created by the PPT that had irregular amounts (and in places fairly excessive) new lines between sections, presumably from conditional parts of the jinja template.It's a very low priority issue, but fixing the spacing would create a more professional and polished output.
When someone is fixing the spacing commands here, it would be good to create a small section in the docs explaining how to properly format spacing notation for jinja, so future contributors can easily reference this.
The text was updated successfully, but these errors were encountered: