Shopify / erb_lint

Lint your ERB or HTML files
MIT License
670 stars 122 forks source link

Suggestion: Support for parallelism #234

Open alinmantale opened 3 years ago

alinmantale commented 3 years ago

It would be great if there was the possibility to run tasks in parallel natively or using other gem e.g. "parallel_tests". Currently the task itself is single threaded, and with a larger codebase the lint takes around 30 second to 1 minute to complete.

zachfeldman commented 2 years ago

This isn't exactly what you asked, but I created a pull request for a cache that makes subsequent executions with only a small # of files changed much faster: https://github.com/Shopify/erb-lint/pull/268

Also this is an interesting issue, they're considering pulling erb-lint and other template linters into rubocop - maybe then you could use rubocops parallelization without having to implement it here?

mculp commented 1 year ago

Also, perhaps look into Lefthook. You could create a few different sections of files and configure them to run in parallel. Lefthook is a git-hook based tool, but you can also run the commands on-demand.

I originally came to this webpage to mention possibly porting the rubocop --server feature, but if they're going to pull this upstream, I guess I'll get my wish eventually.

ERBLint currently takes ~1-2s on a handful of staged files where rubocop is ~200ms. Not the end of the world, but it's the bottleneck. I have not tried --cache though. I just found that!