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

Run PHP CodeSniffer in parallel mode #20

Closed
Cambis opened this issue Nov 13, 2023 · 0 comments · Fixed by #21
Closed

Run PHP CodeSniffer in parallel mode #20

Cambis opened this issue Nov 13, 2023 · 0 comments · Fixed by #21
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Cambis
Copy link
Contributor

Cambis commented Nov 13, 2023

Run PHP CodeSniffer in parallel mode

PHP CodeSniffer has a parallel mode which can be used to speed up the time it takes to run the suite, this can be especially useful in larger projects where we checking hundreds of files.

The process is largely undocumented hence this open issue: squizlabs/PHP_CodeSniffer#1732

Reason for proposed change

  • Decrease the time it takes to run phpcs/phpcbf
  • Speed up CI processes
cameronbryers@westpac-web:/var/www/html$ composer phpcs
> bespoke-phpcs
............................................................  60 / 512 (12%)
............................................................ 120 / 512 (23%)
............................................................ 180 / 512 (35%)
............................................................ 240 / 512 (47%)
............................................................ 300 / 512 (59%)
............................................................ 360 / 512 (70%)
............................................................ 420 / 512 (82%)
............................................................ 480 / 512 (94%)
................................                             512 / 512 (100%)


Time: 13.26 secs; Memory: 54MB

cameronbryers@westpac-web:/var/www/html$ composer phpcs -- --parallel=8
> bespoke-phpcs '--parallel=8'
........ 8 / 8 (100%)


Time: 2.64 secs; Memory: 6MB

cameronbryers@westpac-web:/var/www/html$ composer phpcs -- --parallel=16
> bespoke-phpcs '--parallel=16'
................ 16 / 16 (100%)


Time: 3.1 secs; Memory: 6MB
@Cambis Cambis added the enhancement New feature or request label Nov 13, 2023
@n8-dev n8-dev added the good first issue Good for newcomers label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants