Skip to content

Conversation

@miku3920
Copy link

This pull request addresses a compatibility issue with Windows paths in PHP_CodeSniffer. When the system uses backslashes (e.g., \\) as directory separators on Windows, it can lead to problems in pattern matching with preg_match.

To fix this issue, we have added a conditional check to ensure that Windows paths are consistently using forward slashes (e.g., /) as directory separators before adding them to the ignore patterns. This change ensures that paths are correctly matched and ignored, even on Windows systems.

This should resolve the "Compilation failed" warning related to preg_match that you've encountered.

Please review this pull request and let us know if it solves your problem. If you have any further comments or suggestions, feel free to share them. Thank you!

@wongjn
Copy link
Owner

wongjn commented Oct 21, 2023

Thank you for the contribution! A test covering this would be good, but I am aware that is not possible in CI and blocked by #71 at the moment.

@miku3920
Copy link
Author

Thank you for your prompt response and guidance. I'm eager to contribute a test for this fix. Could you please provide some insights on how to write the test and the necessary tools I should prepare for the task? Your advice would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants