thibaudcolas / curlylint

Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid
https://www.curlylint.org/
MIT License
236 stars 25 forks source link

Add pre-commit option require_serial #123

Closed adamchainz closed 2 years ago

adamchainz commented 2 years ago

By default, pre-commit splits the files it wants to lint into one list per processor and launches one tool process for each. Since curlylint performs parallelization internally, this behaviour leads to a detrimental explosion of N * N processes. Setting require_serial: true in the hook definition disables pre-commit's parallelization.

Black is in the same situation and sets require_serial: true: https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml .

marcbelmont commented 1 year ago

Running from pre-commit with require_serial: true is still triggering a high CPU load (99%) on my machine.

adamchainz commented 1 year ago

This was not meant to reduce the CPU usage. It's intentional that curlylint consumes as much CPU as possible whilst running, it uses parallelization in order to complete as fast as possible.

Also don't comment on old PR's, file a new issue and refer to previous relevant changes.