WordPress / theme-check

Theme Check plugin
https://wordpress.org/plugins/theme-check/
333 stars 108 forks source link

Let's make a way to run the theme-check via cli against arbitrary folders? #438

Open georgestephanis opened 1 year ago

georgestephanis commented 1 year ago

Previously: #2

Discussed in Slack here:

https://wordpress.slack.com/archives/C02RP4Y3K/p1670944400058739

It feels like being able to run the theme-check via wp-cli as something like

wp theme-check [slug]
wp theme-check /tmp/downloads/downloaded-theme/

to catch either installed themes and stuff in folders outside of WordPress itself -- as a way to run preflight checks, and potentially tie into deployments and github actions -- would be useful, so themes could be scanned not only from being installed, but arbitrary theme directories that aren't exposed to a functional installation.

georgestephanis commented 1 year ago

As an ancillary thing, if it would be possible to also have documentation for how to set it up for GitHub actions, I suspect a number of themes that manage their code primarily on gh would be able to leverage it -- not necessarily on every commit, but as a pre-tagging-of-a-release check.

But that would be much more of a subsequent thing down the road.

dd32 commented 1 year ago

This would've made #448 much easier to test :)

If it helps anyone to implement this, the Theme Directory runs theme check via this code: https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php?rev=12189&marks=1011-1041#L1006