-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Jinja template, css, js precommit filters #3315
Conversation
I'm wrong. #2379 changes 124 files, and this only changes 39, so this must be doing less? |
Ah, pelican/tests/output was excluded. I ran the same pre-commit filters (djhtml, djcss, djjs) on that directory as well, and now this change is 160 files (compared to 124 in #2379). |
One subtlety: pelican/tests/output is still excluded from the pre-commit filter, so for that directory this is a one-time change. Perhaps we should change pre-commit to include those dirs? |
FYI, I looked at four jinja template formatting projects:
It looked to me like djhtml was clean, active, maintained. djLint might also be a reasonable choice (not sure), but I went with djhtml. |
I imagine you're right that Regarding template formatting project selection, I don't have a strong opinion on the matter. I think the key difference is that DjHTML only focuses on indentation, while, say, djLint includes formatting in its scope, with for example configuration options for inserting newlines before/after tags, closing void tags, etc. Like DjHTML, it seems djLint also has configuration options for formatting CSS & JS, for what that's worth. That all said, I think the fact that DjHTML only focuses on indentation is perhaps a feature rather than a shortcoming, and it's probably the one I would be inclined to select as well. |
What are next steps here? I filed PR #3316 to apply pre-commit filters to all directories. Could merge that, then redo this, then merge this? |
Sounds good, I'll unconflict this right now. |
To unconflict, I did
So, no manual fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @boxydog!
Pull Request Checklist
This is an automated replacement for #2379.
There are no manual fixes.
If this is acceptable, we can merge it and close #2379.
If this change gets conflicted, we can remake the PR, drop in the .pre-commit-config.yaml changes, and apply the rest automatically. (To apply to pelican/tests/output, temporarily comment out that line in the config, run
pre-commit run --all djhtml
and djcss and djjs, then uncomment that line.)