-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faulty Core Fixes: Comment inside a single line embedded PHP block #1017
Comments
@pento Thanks for reporting this one. Lovely simple example & the fixer conflict is not between two different sniffs, but within the The tokenizer will tokenize whitespace at the end of a This is an upstream issue and we'll need to keep our fingers crossed for a fix to still be accepted for PHPCS 2.x. There are two ways this could be fixed: either in the tokenizer or in the sniff, I will open an issue upstream to see what can be done. In the mean time: Have you got any idea whether there is more code in WP where this is happening ? |
There are 30 instances, across 19 files. I'm globally excluding the Changing the comment style for those instances feels kind of weird. |
If it was just the one instance it would be a quick fix, with 30, I agree that's not a solution. I've opened an issue upstream to report the conflict and to discuss which solution would be acceptable and whether it can still go into PHPCS 2.x: squizlabs/PHP_CodeSniffer#1549 In the mean time, I've also created a patch. The patch is for the sniff-based solution. |
FYI: Patches for both the PHPCS 2.x & 3.x branches have been pulled upstream in the mean time. Fingers crossed they'll both get accepted. |
@pento My PRs upstream have been merged - both the 2.x as well as the 3.x versions! 🎉 Are you testing with the |
I'm on the 2.9.1 release - I don't suppose there's an easy way to switch VVV to the 2.9 branch? :) |
I don't use VVV myself much and haven't used it for quite a while anyhow, so I'm not the best person to ask. I suppose you could check the VVV provision scripts to see how VVV pulls in PHPCS - Composer/Git.
After that you will probably need to reprovision the box. |
Got it, it works! 😀 |
I had /shrug I've now updated that to |
@ntwb That sounds about right as PHPCS 2.9.2 has not been released yet. (and I'm presuming you also have WPCS |
Yup: |
After a173ae7, this code will get stuck in a loop:
It works correctly if the comment is removed. (The
a
is so that the?>
isn't removed byPSR2.Files.ClosingTag.NotAllowed
.)In Core, this can be seen in
src/wp-admin/custom-background.php
.The text was updated successfully, but these errors were encountered: