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

Still pretty verbose when running pre-commit run --all-files #31

Closed
richarddewit opened this issue May 26, 2021 · 5 comments
Closed

Still pretty verbose when running pre-commit run --all-files #31

richarddewit opened this issue May 26, 2021 · 5 comments

Comments

@richarddewit
Copy link

When running pre-commit run --all-files it's still pretty verbose:

djhtml...................................................................Failed
- hook id: djhtml
- files were modified by this hook

All done! \o/
16 templates left unchanged.
All done! \o/
16 templates left unchanged.
All done! \o/
16 templates left unchanged.
All done! \o/
16 templates left unchanged.
All done! \o/
16 templates left unchanged.
All done! \o/
16 templates left unchanged.
reindented babeldat/core/templates/partials/_menu.html
All done! \o/
1 template reindented, 15 templates left unchanged.
All done! \o/
11 templates left unchanged.

FYI: I had 16 files staged, only 4 of them were templates

@JaapJoris
Copy link
Member

That is indeed pretty verbose 😂

Do you still experience this issue with the latest version? The current branch main prints the following output:

djhtml...................................................................Failed
- hook id: djhtml
- files were modified by this hook

reindented template1.html
reindented template2.html
reindented template3.html
... [etc]
67 templates have been reindented.
44 templates were already perfect!

@JaapJoris
Copy link
Member

I've released a new version that contains the improved output formatting. You can now upgrade with pre-commit autoupdate. Thank you for your help!

@JaapJoris
Copy link
Member

JaapJoris commented May 26, 2021

I tested it again with version 1.4.3 but the output is still too verbose:

$ pre-commit run --all
djhtml...................................................................Failed
- hook id: djhtml
- files were modified by this hook

reindented jaapjoris/templates/base.html
reindented jaapjoris/templates/cms/page.html
reindented jaapjoris/templates/text.html
reindented jaapjoris/templates/button.html
4 templates have been reindented.
reindented jaapjoris/templates/video.html
reindented jaapjoris/templates/contact.html
reindented jaapjoris/templates/image.html
3 templates have been reindented.

It seems that pre-commit has called djhtml two times: Once with 4 arguments and once with 3. How can you tell pre-commit not to do that? 🤔

@JaapJoris JaapJoris reopened this May 26, 2021
@richarddewit
Copy link
Author

richarddewit commented May 26, 2021

How can you tell pre-commit not to do that?

¯\_(ツ)_/¯

@JaapJoris
Copy link
Member

JaapJoris commented May 26, 2021

Found it: setting require_serial to true will cause pre-commit to only call djhtml once. This produces much nicer output so I've updated the default pre-commit hook. In theory, parallel processing would make it faster but in practice I didn't notice much difference anyway ¯\_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants