From 100cebdce37a9962bdc89561d4da579fa9d913e7 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 28 Mar 2024 10:55:01 -0300 Subject: [PATCH 1/2] Inform user if parallelization is disabled at runtime and why --- src/Runner.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Runner.php b/src/Runner.php index b5afa71d05..592a0c727a 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -425,11 +425,17 @@ private function run() // If verbosity is too high, turn off parallelism so the // debug output is clean. if (PHP_CODESNIFFER_VERBOSITY > 1) { + if ($this->config->parallel > 1) { + echo "Parallel processing disabled for clearer output at higher verbosity levels."; + } $this->config->parallel = 1; } // If the PCNTL extension isn't installed, we can't fork. if (function_exists('pcntl_fork') === false) { + if ($this->config->parallel > 1) { + echo "Parallel processing requires the 'pcntl' PHP extension. Falling back to single-thread execution."; + } $this->config->parallel = 1; } From 7841799df5559317a4b1003ce524bad0250def34 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 1 Apr 2024 10:08:47 -0300 Subject: [PATCH 2/2] Update Runner.php --- src/Runner.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Runner.php b/src/Runner.php index 592a0c727a..607c1271f3 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -426,7 +426,7 @@ private function run() // debug output is clean. if (PHP_CODESNIFFER_VERBOSITY > 1) { if ($this->config->parallel > 1) { - echo "Parallel processing disabled for clearer output at higher verbosity levels."; + echo "Parallel processing disabled for clearer output at higher verbosity levels.".PHP_EOL; } $this->config->parallel = 1; } @@ -434,7 +434,7 @@ private function run() // If the PCNTL extension isn't installed, we can't fork. if (function_exists('pcntl_fork') === false) { if ($this->config->parallel > 1) { - echo "Parallel processing requires the 'pcntl' PHP extension. Falling back to single-thread execution."; + echo "Parallel processing requires the 'pcntl' PHP extension. Falling back to single-thread execution.".PHP_EOL; } $this->config->parallel = 1; }