Skip to content
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

Add a plugin generator #218

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Add a plugin generator #218

merged 2 commits into from
Sep 18, 2023

Conversation

snim2
Copy link
Contributor

@snim2 snim2 commented Sep 18, 2023

Add a new generator to clone code in our WordPress plugin repo:

https://github.com/dxw/wordpress-plugin-template

Resolves: #162

Testing

Run whippet generate plugin and maybe try the relevant options, e.g. --nogitignore


  • Includes tests (if new features are introduced)
  • Commit message includes link to the ticket/issue
  • Changelog updated
  • PR open against dxw's Homebrew Tap to point the Whippet formula to the new version number

Copy link
Contributor

@RobjS RobjS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snim2 This generally looks sensible to me, but there are a few undeclared properties used that will generate errors in PHP 8.2. Maybe it'd be worth having unit tests for this class so those would be picked up in CI?

I've realised this will also apply to some of the existing classes that don't have test coverage, so I've opened an issue for that: #221

private $unique_temp_id;

function __construct($options) {
$this->options = $options;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a dynamic property, this will generate errors in PHP 8.2

$this->options = $options;

if(isset($this->options->directory)) {
$this->target_dir = getcwd() . '/' . $this->options->directory;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$target_dir will also need declaring as a property for PHP 8.2

@snim2 snim2 requested a review from RobjS September 18, 2023 10:22
Copy link
Contributor

@RobjS RobjS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending rebase 👍

Fixes #162

Add a new generator to clone code in our WordPress plugin repo:

https://github.com/dxw/wordpress-plugin-template
This is to avoid errors in PHP8.x.
@snim2 snim2 force-pushed the feature/generate-plugin branch from a65cb3c to 5f083e7 Compare September 18, 2023 10:43
@snim2 snim2 merged commit 1e434b6 into main Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make whippet generate basic plugin
2 participants