From 45dca29709187b432d8a36b85077f9784b819fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Mon, 20 May 2024 10:02:04 +0800 Subject: [PATCH] Support parallel for `cs-fixer` and `phpstan`. --- .php-cs-fixer.php | 26 ++++++++++++++++++++------ phpstan.neon.dist | 4 ++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index f4154f1..7bd7f63 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -1,5 +1,18 @@ setParallelConfig(new ParallelConfig(swoole_cpu_num(), 20)) ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, @@ -23,13 +37,13 @@ 'location' => 'after_declare_strict', ], 'array_syntax' => [ - 'syntax' => 'short' + 'syntax' => 'short', ], 'list_syntax' => [ - 'syntax' => 'short' + 'syntax' => 'short', ], 'concat_space' => [ - 'spacing' => 'one' + 'spacing' => 'one', ], 'blank_line_before_statement' => [ 'statements' => [ @@ -38,7 +52,7 @@ ], 'general_phpdoc_annotation_remove' => [ 'annotations' => [ - 'author' + 'author', ], ], 'ordered_imports' => [ @@ -89,7 +103,7 @@ 'single_line_empty_body' => false, ]) ->setFinder( - PhpCsFixer\Finder::create() + Finder::create() ->exclude('public') ->exclude('runtime') ->exclude('vendor') diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 7a11543..c28cea5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -12,6 +12,10 @@ parameters: - app - config reportUnmatchedIgnoredErrors: false + parallel: + jobSize: 20 + maximumNumberOfProcesses: 32 + minimumNumberOfJobsPerProcess: 2 ignoreErrors: - '#Static call to instance method Hyperf\\HttpServer\\Router\\Router::[a-zA-Z0-9\\_]+\(\)#' - '#Static call to instance method Hyperf\\DbConnection\\Db::[a-zA-Z0-9\\_]+\(\)#'