From 6624b9a05a45f15e93e7db867f9610c2c93432ff Mon Sep 17 00:00:00 2001 From: Johnny Walker Date: Mon, 6 Apr 2026 11:36:30 +0100 Subject: [PATCH 1/2] Clarify ignore patterns in Advanced Usage documentation Updated the ignore patterns explanation to clarify that they are case-insensitive regular expressions and provided additional details on escaping dots in file extensions. --- wiki/Advanced-Usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Advanced-Usage.md b/wiki/Advanced-Usage.md index 2962db4..3e3cdce 100644 --- a/wiki/Advanced-Usage.md +++ b/wiki/Advanced-Usage.md @@ -36,7 +36,7 @@ $ phpcs --ignore=*/tests/*,*/data/* /path/to/code ``` > [!IMPORTANT] -> The ignore patterns are treated as regular expressions. If you do specify a regular expression, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. So use `*` anywhere you would normally use `.*`. Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` instead. +> The ignore patterns are treated as **case-insensitive** regular expressions. In addition to this, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. (So use `*` anywhere you would normally use `.*`.) Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` or `\.inc$` instead. You can also tell PHP_CodeSniffer to ignore a file using a special comment inserted at the top of the file. This will stop the file from being checked, even if it does not match the ignore pattern. From d58f5653c9b410c21acfa9ee3cb6f9c119bdc1cd Mon Sep 17 00:00:00 2001 From: Johnny Walker Date: Mon, 6 Apr 2026 12:30:48 +0100 Subject: [PATCH 2/2] Update ignore patterns explanation in documentation Clarified the explanation of ignore patterns for PHP_CodeSniffer. --- wiki/Advanced-Usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/Advanced-Usage.md b/wiki/Advanced-Usage.md index 3e3cdce..4a538f0 100644 --- a/wiki/Advanced-Usage.md +++ b/wiki/Advanced-Usage.md @@ -36,7 +36,7 @@ $ phpcs --ignore=*/tests/*,*/data/* /path/to/code ``` > [!IMPORTANT] -> The ignore patterns are treated as **case-insensitive** regular expressions. In addition to this, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. (So use `*` anywhere you would normally use `.*`.) Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` or `\.inc$` instead. +> The ignore patterns are treated as **case-insensitive** regular expressions. In addition to this, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. So use `*` anywhere you would normally use `.*`. Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` or `\.inc$` instead. You can also tell PHP_CodeSniffer to ignore a file using a special comment inserted at the top of the file. This will stop the file from being checked, even if it does not match the ignore pattern.