-
Notifications
You must be signed in to change notification settings - Fork 40
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
3.0: support WordPressCS 3.0 #779
Commits on Aug 24, 2023
-
Composer: update WordPressCS + PHPCS dependencies
WordPressCS 3.0.0 has been released and requires a minimum PHPCS version of 3.7.2. This commit updates the WordPressCS and PHPCS dependencies and the documentation referring to those, in all the relevant places. Includes: * Removing the DealerDirect plugin from `require` as it comes with WordPressCS 3.0.0 automatically (via PHPCSUtils) and not having the explicit dependency may prevent conflicts with allowed versions in the future. * Updating the PHP version on which the CS check for the VIPCS native code is being run. With WPCS 3.0, this check is no longer limited to PHP 7.4. * Removing a work-around for WPCS < 3.0 vs PHP 8.0 * Updating the VIPCS native `.phpcs.xml.dist` ruleset. Ref: https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.0
Configuration menu - View commit details
-
Copy full SHA for 0301892 - Browse repository at this point
Copy the full SHA 0301892View commit details -
WPCS 3.0 | Revert previously applied work-arounds
These are no longer needed with WPCS 3.0.0. Ref: 746
Configuration menu - View commit details
-
Copy full SHA for d30a303 - Browse repository at this point
Copy the full SHA d30a303View commit details -
Security/EscapingVoidReturnFunctions: switch to using WPCS PrintingFu…
…nctionsTrait Note: this does mean that the sniff will now also support a `public` `customPrintingFunctions` property which can be adjusted in a custom ruleset. Co-authored-by: Gary Jones <gary.jones@automattic.com>
Configuration menu - View commit details
-
Copy full SHA for 4198a6d - Browse repository at this point
Copy the full SHA 4198a6dView commit details -
AbstractVariableRestrictionsSniff: use WPCS ContextHelper::is_in_isse…
…t_or_empty() Co-authored-by: Gary Jones <gary.jones@automattic.com>
Configuration menu - View commit details
-
Copy full SHA for f124466 - Browse repository at this point
Copy the full SHA f124466View commit details -
AbstractVariableRestrictionsSniff: use WPCS RulesetPropertyHelper::me…
…rge_custom_array() Co-authored-by: Gary Jones <gary.jones@automattic.com>
Configuration menu - View commit details
-
Copy full SHA for 1a8b51c - Browse repository at this point
Copy the full SHA 1a8b51cView commit details -
AbstractArrayAssignmentRestrictions children: adjust for changes in r…
…eceived `$val` The `$val` parameter received by the `callback()` method will no longer automatically have been stripped of quotes. This adjusts the `callback()` methods of the sniff which extend the WPCS `AbstractArrayAssignmentRestrictions` sniff to take this into account.
Configuration menu - View commit details
-
Copy full SHA for 29920a0 - Browse repository at this point
Copy the full SHA 29920a0View commit details -
VIPMinimum ruleset: replace strict comparison sniff
Includes adding PHPCSExtra to the `composer.json` configuration as that is now a direct dependency of VIPCS as VIPCS now uses one of its sniffs in the ruleset. Co-authored-by: Gary Jones <gary.jones@automattic.com>
Configuration menu - View commit details
-
Copy full SHA for 71dbddd - Browse repository at this point
Copy the full SHA 71dbdddView commit details -
VIPMinimum ruleset: replace assignment-in-condition sniff
... which has been split.
Configuration menu - View commit details
-
Copy full SHA for 6d05fff - Browse repository at this point
Copy the full SHA 6d05fffView commit details -
VIPMinimum ruleset: update excludes for the WP/AlternativeFunctions s…
…niff ... to prevent introducing new duplicate error messages. Co-authored-by: Gary Jones <gary.jones@automattic.com>
Configuration menu - View commit details
-
Copy full SHA for 436b0fe - Browse repository at this point
Copy the full SHA 436b0feView commit details -
Update ruleset tests: account for new errors from WPCS
* The `WordPress.Security.ValidatedSanitizedInput` sniff will now also examine `$_SESSION` variables. As the test is about another sniff, let's just ignore the notices coming from `WordPress.Security.ValidatedSanitizedInput`.
Configuration menu - View commit details
-
Copy full SHA for 4094eec - Browse repository at this point
Copy the full SHA 4094eecView commit details -
WordPressVIPMinimum RulesetTest: fix it
To be honest, I'm completely stumped. I can't, for the life of me, think of a reason why the update of the WPCS dependency would suddenly cause all sorts of notices from the `VariableAnalysis` to show, where they previously did not. * It can't be related to the version update of the `VariableAnalysis` sniff in VIPCS 2.3.4, nor the move of the properties from the Go ruleset to the Minimum ruleset as, in that case, the build for the earlier PR/commit should also have been failing. * It can't be related to the VIPCS native `VariableAnalysis` sniff being removed as, in that case, the build for the earlier PR/commit should also have been failing. * VA and WPCS currently have two overlapping CS related dependencies. - PHP_CodeSniffer itself, but as they both use the same version, that can not be a reason for the change in the results. - The Composer plugin, but that shouldn't influence the scan results, other than if a ruleset would not be registered, but if that were the case (for VA), the tests should have been failing before on line 264, which specifically tests the VA standard triggering a notice (and yes, I checked, it did do so correctly before and after). * No new parse errors were accidentally introduced into the test files. As things are, I'm out of ideas of why these warnings are now suddenly showing up, so all I can do is fix them (by selectively silencing the notices from VA). Note: this is only happening in the Minimum ruleset test as VIPGo silences the `UnusedVariable` notice completely.
Configuration menu - View commit details
-
Copy full SHA for 36f1684 - Browse repository at this point
Copy the full SHA 36f1684View commit details