Skip to content
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

Fix spacing in jinja outputs and add small guide to PPT docs #303

Closed
OliviaLynn opened this issue Oct 16, 2023 · 1 comment · Fixed by #373
Closed

Fix spacing in jinja outputs and add small guide to PPT docs #303

OliviaLynn opened this issue Oct 16, 2023 · 1 comment · Fixed by #373
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@OliviaLynn
Copy link
Member

OliviaLynn commented Oct 16, 2023

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.

@OliviaLynn OliviaLynn added enhancement New feature or request good first issue Good for newcomers labels Oct 16, 2023
@delucchi-cmu delucchi-cmu added this to the Release tag 2.0 milestone Feb 1, 2024
@drewoldag
Copy link
Collaborator

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!

@drewoldag drewoldag linked a pull request Feb 2, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants