From ec9da1c015cf5eed231222b1094d3e36fdac5f93 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 6 Mar 2026 13:43:43 +0000 Subject: [PATCH 1/8] Requirements: document PCNTL as a recommended PHP extension --- wiki/Requirements.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wiki/Requirements.md b/wiki/Requirements.md index 80fe2ba..3174cfb 100644 --- a/wiki/Requirements.md +++ b/wiki/Requirements.md @@ -6,7 +6,8 @@ Additionally, PHP_CodeSniffer requires the following PHP extensions to be enable - SimpleXML: used to process ruleset XML files - XMLWriter: used to create some report formats -The following PHP extension is not required, but is strongly recommended: +The following PHP extensions are not required, but are strongly recommended: - iconv: used for accurate character length calculation in files containing multibyte characters. Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations. +- PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. From e3e23ceb9f2c6445440847ed6e45478c0de6ea6b Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 6 Mar 2026 13:43:57 +0000 Subject: [PATCH 2/8] Requirements: add warning about gRPC extension and parallel processing The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. Refs PHPCSStandards/PHP_CodeSniffer 294 --- wiki/Requirements.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wiki/Requirements.md b/wiki/Requirements.md index 3174cfb..3de7514 100644 --- a/wiki/Requirements.md +++ b/wiki/Requirements.md @@ -10,4 +10,7 @@ The following PHP extensions are not required, but are strongly recommended: - iconv: used for accurate character length calculation in files containing multibyte characters. Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations. - PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. +> [!WARNING] +> The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, make sure the `grpc.enable_fork_support` and `grpc.poll_strategy` ini settings are properly configured. See [this comment](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/294#issuecomment-1906558549) for more details. + Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. From a4120b0157d4f8738be74e0c7941963c09953055 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Mar 2026 09:01:20 -0300 Subject: [PATCH 3/8] Add details on how to handle the gRPC extension directly in the text instead of pointing to the issue --- wiki/Requirements.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wiki/Requirements.md b/wiki/Requirements.md index 3de7514..81e5a5f 100644 --- a/wiki/Requirements.md +++ b/wiki/Requirements.md @@ -11,6 +11,9 @@ The following PHP extensions are not required, but are strongly recommended: - PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. > [!WARNING] -> The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, make sure the `grpc.enable_fork_support` and `grpc.poll_strategy` ini settings are properly configured. See [this comment](https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/294#issuecomment-1906558549) for more details. +> The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, either do not use the `--parallel` CLI option or configure the extension's ini settings as follows: +> ``` +> phpcs -d grpc.enable_fork_support=1 -d grpc.poll_strategy=epoll1 [other options] +> ``` Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. From bc0b73c2a64983d8fb30c79aff3a8366f6f4236c Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Mar 2026 10:46:09 -0300 Subject: [PATCH 4/8] Add details on how to handle the gRPC extension directly in the text instead of pointing to the issue I opted to use "```text" instead of "```bash" as the latter highlights only "" which I don't think helps in this case. --- wiki/Requirements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Requirements.md b/wiki/Requirements.md index 81e5a5f..c60c6fb 100644 --- a/wiki/Requirements.md +++ b/wiki/Requirements.md @@ -12,7 +12,7 @@ The following PHP extensions are not required, but are strongly recommended: > [!WARNING] > The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, either do not use the `--parallel` CLI option or configure the extension's ini settings as follows: -> ``` +> ```text > phpcs -d grpc.enable_fork_support=1 -d grpc.poll_strategy=epoll1 [other options] > ``` From bdd42b4662b4937d17a9f1e6243cb80d4cee0f87 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 13 Mar 2026 10:39:59 -0300 Subject: [PATCH 5/8] Spellcheck: also ignore code blocks inside blockquotes The existing regex pattern for ignoring code blocks only matched blocks at the start of a line (with optional whitespace). This update makes it also match code blocks inside markdown blockquotes, where lines are prefixed with `>`. --- .cspell.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index aafafcd..86f5c41 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -12,9 +12,9 @@ patterns: - name: markdown_code_block pattern: | / - ^(\s*`{3,})[a-z]+ # match the ``` with a language modifier - [\s\S]*? # the block of code - ^\1 # end of the block + ^((?:>\s*)?`{3,})[a-z]+ # match the ``` with a language modifier, optionally inside a blockquote + [\s\S]*? # the block of code + ^\1 # end of the block /gmx - name: markdown_inline_code pattern: /(\s*`)[^`\n]{3,}`/gmx From cda898f658df300209799150b84cd2426ece3dc7 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Mon, 16 Mar 2026 09:56:27 -0300 Subject: [PATCH 6/8] Fix code block regex to also handle indented code blocks --- .cspell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cspell.yml b/.cspell.yml index 86f5c41..c2216aa 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -12,7 +12,7 @@ patterns: - name: markdown_code_block pattern: | / - ^((?:>\s*)?`{3,})[a-z]+ # match the ``` with a language modifier, optionally inside a blockquote + ^([\s>]*`{3,})[a-z]+ # match the ``` with a language modifier, optionally inside a blockquote [\s\S]*? # the block of code ^\1 # end of the block /gmx From 28669ef9145b177a0ddd80717a7810d1fac03f63 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Mon, 16 Mar 2026 09:56:36 -0300 Subject: [PATCH 7/8] Move individual sniff requirements above gRPC warning --- wiki/Requirements.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wiki/Requirements.md b/wiki/Requirements.md index c60c6fb..eac3823 100644 --- a/wiki/Requirements.md +++ b/wiki/Requirements.md @@ -10,10 +10,10 @@ The following PHP extensions are not required, but are strongly recommended: - iconv: used for accurate character length calculation in files containing multibyte characters. Without this extension, some sniffs, like `Generic.Files.LineLength`, may report incorrect results for lines containing non-ASCII characters, as PHP_CodeSniffer will fall back to byte-based length calculations. - PCNTL: required for parallel processing via the `--parallel` CLI option. Without this extension, PHP_CodeSniffer will not be able to check multiple files simultaneously. +Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. + > [!WARNING] > The gRPC PHP extension is known to cause PHP_CodeSniffer to hang when running with parallel processing enabled. If the gRPC extension is loaded, either do not use the `--parallel` CLI option or configure the extension's ini settings as follows: > ```text > phpcs -d grpc.enable_fork_support=1 -d grpc.poll_strategy=epoll1 [other options] > ``` - -Individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) manual page for a list of these requirements. From 623c34c53b805132d7b93d91e69bd704f8e36039 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 18 Mar 2026 14:09:48 +0100 Subject: [PATCH 8/8] cspell: fix regex doc indentation --- .cspell.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cspell.yml b/.cspell.yml index c2216aa..fdb0e46 100644 --- a/.cspell.yml +++ b/.cspell.yml @@ -13,8 +13,8 @@ patterns: pattern: | / ^([\s>]*`{3,})[a-z]+ # match the ``` with a language modifier, optionally inside a blockquote - [\s\S]*? # the block of code - ^\1 # end of the block + [\s\S]*? # the block of code + ^\1 # end of the block /gmx - name: markdown_inline_code pattern: /(\s*`)[^`\n]{3,}`/gmx