Repository navigation
Upgrade humanmade/coding-standards to 2.x instead of disabling Composer's security blocking - #66
Merged
Merged
Conversation
humanmade/coding-standards 1.x pins wp-coding-standards/wpcs 2.3.0, which Composer blocks for its security advisory, so CI disabled the blocking. 2.x uses WPCS 3 but needs PHP 8.2, while the plugin is tested down to PHP 8.1, so install it in its own tools/phpcs project, which the cs-check and cs-fix scripts set up, and drop COMPOSER_NO_SECURITY_BLOCKING from CI. Adapt to the new standard: exclude the inline comment full stop sniff, the WPCS 3 one-structure-per-file sniff (alongside the multiple classes sniffs already excluded), and the reserved keyword parameter names sniff for stubs, which keep the parameter names of the functions they override; apply the automatic fixes and explain the empty catch. Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
HM 2.x requires inline comments to end with a full stop, exclamation mark or question mark. Punctuate them, and reword the two comments that ended in commented-out code. The comment of the InvalidDocblock suppression in tests/unit/BaseTestCase.php is left to the change that removes it. Generic.Files.OneObjectStructurePerFile, which WPCS 3 adds to WordPress-Core, is the same check as the multiple classes sniffs already excluded, so say so next to its exclusion. Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
…-keyword sniff only for WP-CLI's get_option($default_value), wp_list_pluck($input_list, $field) and wpdb::get_results($output) had other names, so named arguments failed. Only WP-CLI's $callable and $exit are reserved keywords on purpose. Claude-Session: https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
humanmade/coding-standards 1.x requires wp-coding-standards/wpcs 2.3.0, which Composer blocks for a security advisory, so CI installed dependencies with
COMPOSER_NO_SECURITY_BLOCKING=1.Before:
After:
https://claude.ai/code/session_01WNSb29tptiTQoc44Tk7XZW