-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned suddenly wanting _unaligned_ arrows #2400
Comments
@smileBeda Tried, but cannot reproduce the issue with the code sample provided. Also, that sniff has barely had any changes for WPCS 3.x, so there is no reason to see changed behaviour. Suggest: close, unless a valid reproduction case is added within the next week. |
@jrfnl I do not fully understand why, it appears to be related to depth of HTML tree or something else. See the full code, I placed the double arrow array in several places and you will see that it sometimes flags as wrong, sometimes leaves it alone.
You will notice that
Also hereby attached the full PHP file, in case above indentation gets messed up: |
@smileBeda Ah! That explains it. That is related to the Again: that behaviour has not changed in WPCS 3.0.0, it was always that way. |
OK, I then just do not recall having seen it before, not a surprise. I will try to add a custom rule to extend the column width then. And since it seems to not measure the array length but the full length including indentation from file column 0.... that is reached extremely quickly. Odd. But ok. |
Bug Description
Maybe I am dreaming, but I am very sure that up and until now, a well aligned array in WP CS meant the below, in all cases:
However, I just noticed that WPCS tries to correct them to below, when inside a WP Archive template HTML markup:
Minimal Code Snippet
WPCS tries to correct that even if it is correctly aligned and says it should not be aligned vertically
Yet, if I plant the array in a function, or plain PHP file, it expects me to align vertically the arrows:
Error Code
Environment
The text was updated successfully, but these errors were encountered: