News

Run Laravel Pint Faster in Parallel Mode

Published
Run Laravel Pint Faster in Parallel Mode image

Laravel Pint was recently updated with a --parallel flag, making Pint 40x faster and "fully leverage the parallel capabilities of php cs fixer." You can use it like so:

vendor/bin/pint --parallel
 
vendor/bin/pint --help
...
--parallel Runs the linter in parallel (Experimental)

Note: This flag is marked as "Experimental" and potentially unstable.

To access this flag, you need to update to the latest Laravel Pint version (at least v1.23.0). You can update your dependencies with Composer:

composer update laravel/pint -w

Along with the parallel flag, release v1.23.0 allows extending a pint configuration from another file. This is useful if you have an organization pint config you share across your projects, however, want to tweak a few settings on a per-project basis:

{
"extend": "./base.json",
"preset": "laravel",
"rules": {
"declare_strict_types": true,
"lowercase_keywords": true,
"lowercase_static_reference": true,
"final_class": true,
"fully_qualified_strict_types": false,
"global_namespace_import": {
"import_functions": true
}
}
}

I am not certain if this feature is considered stable (it is not yet documented)—see Pull Request #373 for implementation details and discussion.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article