Skip to content

Commit

Permalink
Merge pull request #1066 from ergebnis/feature/parallel
Browse files Browse the repository at this point in the history
Enhancement: Enable parallel runner
  • Loading branch information
localheinz committed May 17, 2024
2 parents e7193ca + 3d2d464 commit 14be1cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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

0 comments on commit 14be1cc

Please sign in to comment.