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

Adds 'parallel' option support to phpcs task. #1155

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

mrmishmash
Copy link
Contributor

@mrmishmash mrmishmash commented Oct 19, 2024

Q A
Branch master for features and deprecations
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Documented? yes
Fixed tickets comma-separated list of tickets fixed by the PR, if any

This change adds support for 'parallel' option for the phpcs and phpcbf fixer. By default the option is set to null, which means it
runs normally, if it's a positive integer that's the number of processes that will be used. If 'auto' is used the number of processors on the machine will determine the number.

New Task Checklist:

  • Are the dependencies added to the composer.json suggestions?
  • Is the doc/tasks.md file updated?
  • Are the task parameters documented?
  • Is the task registered in the tasks.yml file?
  • Does the task contains phpunit tests?
  • Is the configuration having logical allowed types?
  • Does the task run in the correct context?
  • Is the run() method readable?
  • Is the run() method using the configuration correctly?
  • Are all CI services returning green?

Copy link
Contributor

@veewee veewee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good!
I do have a remark about the auto CPU detection

src/Task/Phpcs.php Outdated Show resolved Hide resolved
@mrmishmash
Copy link
Contributor Author

Yeah I was also thinking about this, it just adds complexity to the task and there also wasn't a straightforward way to test it. Good point that this should be done in phpcs.

In any case developers can add detection of the number of cores in their build processes and set it as the value for the 'parallel' option.

So with that in mind I have removed the auto detection of the cpu cores. Thank you for the input.

@veewee veewee added this to the 2.9.0 milestone Oct 21, 2024
@veewee veewee merged commit eca0436 into phpro:v2.x Oct 21, 2024
20 checks passed
@veewee
Copy link
Contributor

veewee commented Oct 21, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants