wp-cli / scaffold-command

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.
MIT License
165 stars 87 forks source link

Add GitHub as valid CI for plugin and theme scaffold #331

Closed ernilambar closed 7 months ago

ernilambar commented 7 months ago

Fixes https://github.com/wp-cli/scaffold-command/issues/330

Note: For theme, in theme-bootstrap.muscatche, there is code for checking PHP version. So test is exited for PHP greater than 8.0. Is this still valid?

if ( PHP_MAJOR_VERSION >= 8 ) {
    echo "The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    exit( 1 );
}
danielbachhuber commented 7 months ago

For theme, in theme-bootstrap.muscatche, there is code for checking PHP version. So test is exited for PHP greater than 8.0. Is this still valid?

Can you test?

ernilambar commented 7 months ago

@danielbachhuber I created sample theme and removed that conditional checks. All tests have run successfully. https://github.com/ernilambar/sample-theme/pull/3

Sample plugin check: https://github.com/ernilambar/sample-plugin/pull/3

ernilambar commented 7 months ago

@danielbachhuber It looks ok for me to remove following code from theme-bootstrap.mustache.


if ( PHP_MAJOR_VERSION >= 8 ) {
    echo "The scaffolded tests cannot currently be run on PHP 8.0+. See https://github.com/wp-cli/scaffold-command/issues/285" . PHP_EOL; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    exit( 1 );
}

Should it be done in separate PR?

danielbachhuber commented 7 months ago

Separate PR sounds good