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

Reduce the need for re-running `scaffold package-*` commands #4751

schlessera opened this Issue Mar 27, 2018 · 2 comments


1 participant

schlessera commented Mar 27, 2018

Right now, the scaffold package-* commands not only provide scaffolding code. They actually "copy-paste" dependencies into the package that should be external libraries instead.

We need to look into reducing the need to constantly run update commits across all packages when framework code changes, most notably the utils/* functionality and the test suite. These should either be separate libraries or be directly used from the framework.

@schlessera schlessera added this to the 2.0.0 milestone Mar 27, 2018


This comment has been minimized.


schlessera commented Jul 19, 2018

The new package now takes care of this. By simply requiring this package as a development dependency, it will become active (through the use of the PHP Composter framework):

composer require --dev wp-cli/regenerate-readme

This will cause the following:

  • On precommit, it will compare the hash of the file before and after a vendor/bin/wp scaffold package-readme . --force. If the hashes were different, it will create a file called .commit-readme-md.
  • On postcommit, it will check whether a file .commit-readme-md exists and if it does, it does a git add followed by a git commit --amend -C HEAD --no-verify. This modifies the commit after the fact to include the modified file.

This means that contributors don't need to take care of manually regenerating the file anymore. If they change some doc blocks or some partial markdown files, the file will automatically be adapted.

@schlessera schlessera modified the milestones: 2.0.0, 2.1.0 Aug 10, 2018


This comment has been minimized.


schlessera commented Aug 10, 2018

The main functionality has been added with v2.0.0, but was only used within the wp-cli/wp-cli-tests repo.

This needs to be further tested and then implemented within all packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment