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

Enhancement: Enable parallel runner #1066

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ For a full diff see [`6.28.1...main`][6.28.1...main].
### Changed

- Updated `friendsofphp/php-cs-fixer` ([#1065]), by [@dependabot]
-
- Enabled parallel runner ([#1066]), by [@localheinz]

## [`6.28.1`][6.28.1]

For a full diff see [`6.28.0...6.28.1`][6.28.0...6.28.1].
Expand Down Expand Up @@ -1650,6 +1651,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#1061]: https://github.com/ergebnis/php-cs-fixer-config/pull/1061
[#1062]: https://github.com/ergebnis/php-cs-fixer-config/pull/1062
[#1065]: https://github.com/ergebnis/php-cs-fixer-config/pull/1065
[#1066]: https://github.com/ergebnis/php-cs-fixer-config/pull/1066

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
2 changes: 2 additions & 0 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Ergebnis\PhpCsFixer\Config;

use PhpCsFixer\Config;
use PhpCsFixer\Runner;

final class Factory
{
Expand All @@ -37,6 +38,7 @@ public static function fromRuleSet(RuleSet $ruleSet): Config
$config = new Config($ruleSet->name()->toString());

$config->registerCustomFixers($ruleSet->customFixers()->toArray());
$config->setParallelConfig(Runner\Parallel\ParallelConfigFactory::detect());
$config->setRiskyAllowed(true);
$config->setRules($ruleSet->rules()->toArray());

Expand Down
2 changes: 2 additions & 0 deletions test/Unit/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Ergebnis\PhpCsFixer\Config\RuleSet;
use Ergebnis\PhpCsFixer\Config\Test;
use PhpCsFixer\Fixer;
use PhpCsFixer\Runner;
use PHPUnit\Framework;

/**
Expand Down Expand Up @@ -92,6 +93,7 @@ public function testFromRuleSetCreatesConfigWhenCurrentPhpVersionIsEqualToOrGrea
$config = Factory::fromRuleSet($ruleSet);

self::assertEquals($customFixers->toArray(), $config->getCustomFixers());
self::assertEquals(Runner\Parallel\ParallelConfigFactory::detect(), $config->getParallelConfig());
self::assertTrue($config->getRiskyAllowed());
self::assertSame($rules->toArray(), $config->getRules());
self::assertTrue($config->getUsingCache());
Expand Down
Loading