Automattic / VIP-Coding-Standards

PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/
Other
236 stars 40 forks source link

Review the WordPressVIPMinimum.Security.Twig sniff #545

Open jrfnl opened 4 years ago

jrfnl commented 4 years ago

Review the WordPressVIPMinimum.Security.Twig sniff for the following in as far as relevant to that sniff:

Other:

Sniff basics, but changes need to be lined up for next major release:

Once PHPCS/PHPCSUtils supports this:

jrfnl commented 4 years ago

I've had a quick initial look at this sniff with an eye on #552 / PHPCS 4.x.

The sniff currently examines both PHP and JS files, but does not have a test case file for the JS side of things, nor any JS syntax specific sniff code.

Questions: As PHPCS 4.x may still be a year or more before it is released:

  1. Should a JS test case file be added to verify that JS is currently actually being examined correctly ? If no, I'd propose to stop sniffing js files.
  2. If yes and if necessary, should support for properly checking JS code be added for the time being ? If yes, this should probably get priority to have the benefit of these checks for as long as possible (until support for PHPCS 3.x is dropped).