Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
176 stars 69 forks source link

PHPCS does not catch whitespace issues #8533

Open reykjalin opened 7 months ago

reykjalin commented 7 months ago

Hmmm, I'm realizing PHPCS doesn't catch this anymore 🤔

Not even if I revert 660a6302dc439aed8751c547952d8724647bb475 to go back to before we updated the sniffs.

Not sure why. Huh.

_Originally posted by @reykjalin in https://github.com/Automattic/woocommerce-payments/pull/8462#discussion_r1546606295_

Not sure why this is happening. The current config doesn't catch this. If you try to revert 660a6302dc439aed8751c547952d8724647bb475, run composer install to go back to before we updated PHPCS and the related sniffs, and then run PHPCS against a file where you call a function like so: call_function($parameter ); PHPCS will not notice the missing space after the first parenthesis either.

So it was probably off before we updated the sniffs for some reason? I have no idea why this is happening. I tried turning the rule on manually by adding <rule ref="WordPress.WhiteSpace"/> to the phpcs.xml.dist but that didn't work either.

reykjalin commented 7 months ago

I'm tagging this with priority: medium because this is a pretty significant style sniff where it's easy to make a mistake. It's not a huge deal in the grand scheme of things, but is important for consistently following the WordPress code style.

vbelolapotkov commented 7 months ago

Routing to devops queue for further investigation. However, the fix should probably be handled in the upstream PHPCS repo.