mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
chore: Update php-cs-fixer configuration to use parallel processing (#6771)
This commit is contained in:
parent
4d054861a0
commit
c01cf5b41c
@ -9,6 +9,10 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
use PhpCsFixer\Config;
|
||||||
|
use PhpCsFixer\Finder;
|
||||||
|
use PhpCsFixer\Runner\Parallel\ParallelConfig;
|
||||||
|
|
||||||
$header = <<<'EOF'
|
$header = <<<'EOF'
|
||||||
This file is part of Hyperf.
|
This file is part of Hyperf.
|
||||||
|
|
||||||
@ -18,7 +22,10 @@ This file is part of Hyperf.
|
|||||||
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
EOF;
|
EOF;
|
||||||
|
|
||||||
return (new PhpCsFixer\Config())
|
$maxProcesses = function_exists('swoole_cpu_num') ? swoole_cpu_num() : 4;
|
||||||
|
|
||||||
|
return (new Config())
|
||||||
|
->setParallelConfig(new ParallelConfig($maxProcesses, 20))
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PSR2' => true,
|
'@PSR2' => true,
|
||||||
@ -99,7 +106,7 @@ return (new PhpCsFixer\Config())
|
|||||||
'single_line_empty_body' => false,
|
'single_line_empty_body' => false,
|
||||||
])
|
])
|
||||||
->setFinder(
|
->setFinder(
|
||||||
PhpCsFixer\Finder::create()
|
Finder::create()
|
||||||
->exclude('bin')
|
->exclude('bin')
|
||||||
->exclude('public')
|
->exclude('public')
|
||||||
->exclude('runtime')
|
->exclude('runtime')
|
||||||
|
@ -6,6 +6,10 @@ parameters:
|
|||||||
level: 5
|
level: 5
|
||||||
bootstrapFiles:
|
bootstrapFiles:
|
||||||
- "bootstrap.php"
|
- "bootstrap.php"
|
||||||
|
parallel:
|
||||||
|
jobSize: 20
|
||||||
|
maximumNumberOfProcesses: 32
|
||||||
|
minimumNumberOfJobsPerProcess: 2
|
||||||
inferPrivatePropertyTypeFromConstructor: true
|
inferPrivatePropertyTypeFromConstructor: true
|
||||||
treatPhpDocTypesAsCertain: true
|
treatPhpDocTypesAsCertain: true
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: false
|
||||||
|
Loading…
Reference in New Issue
Block a user