Escape . in regex#205
Open
mattstauffer wants to merge 2 commits into3.xfrom
Open
Conversation
gcavanunez
reviewed
May 5, 2026
| <!-- PSR1 2.3 Side Effects --> | ||
| <rule ref="PSR1.Files.SideEffects"> | ||
| <!-- Disable side effects for index file and tests --> | ||
| <exclude-pattern>/public/index.php</exclude-pattern> |
There was a problem hiding this comment.
Based on this change would we also want to tweak things here like so?
Suggested change
| <exclude-pattern>/public/index\.php</exclude-pattern> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug, says Claude: PHPCS converts rules to regex by replacing only
*→.*, leaving literal.as the regex any-char metachar. So*/*.cssinstandards/Tighten/ruleset.xml:7becomes the case-insensitive regex ``./..cssi. That matches any path containing a `/` followed somewhere later by `[anychar]css`.MetricsService.php, which is what I was seeing this bug in, lowercased, containsicss(the i + c + s + uppercase S, chars 4-7), which matches.css. So the file got excluded by the rule meant to skip.cssfiles. Same trick excludes files likeabcss.php,csServiceProvider.php, etc.This fix should update these exclude patterns to match what we originally intended. 🤞