From 40b0dac7efabbd11177f77af816f45850e58920c Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 27 Jul 2025 01:45:20 +0200 Subject: [PATCH] Ruleset: improve include/exclude patterns `include-pattern` and `exclude-pattern` directives are a special flavour of regular expressions. From the documentation: > 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. This commit fixes unescaped characters which have special meaning in regular expressions to ensure they are interpreted as literals. Ref: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --- WordPressVIPMinimum/ruleset.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index c0d97376..f5bdb847 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -28,7 +28,7 @@ - *.twig + *\.twig @@ -67,10 +67,10 @@ - *.php - *.inc - *.js - *.css + *\.php + *\.inc + *\.js + *\.css