Open sandrodz opened 6 years ago
Oops, maybe the other files apart from CPT aren't compliant?
Edit: no there're not - taxonomy for one.
Edit2: Taxonomy fixed now via https://github.com/wp-cli/scaffold-command/pull/112, need to check if there's others...
@schlessera, @danielbachhuber - is there any Behat logic that would run linters on generated files? That would be great to ensure we scaffold files that are WordPress compliant.
@gziolo No, but that would be a good addition. I'll create an issue for that.
Awesome, thanks 🙇
to keep track what else needs work
@gitlost @schlessera @gziolo I am checking commands I did that were merged
@gziolo you fixed scaffold block
right?
Good idea @thrijith !
Going to remove this from the 1.1.2 milestone as incomplete at this late stage...
@gziolo you fixed scaffold block right?
Yes, I fixed using Gutenberg's configuration. For PHP, it should be the same as core uses. JS part follows Eslint setup, but I hope it is similar to what JSHint promotes.
Looks like plugin
and plugin-tests
are mostly good to go. I did find an error generated on bootstrap.php. It is a false positive so I added a PR that uses a wpcs exclusion on the line to suppress the error.
Command wp scaffold post-type movie --label=Movie --theme=sample-theme
I used rules from the file we are distributing in scaffold - https://github.com/wp-cli/scaffold-command/blob/main/templates/.phpcs.xml.dist
Is it worth revisiting our scaffold snippets as in 6 years there has been lots of changes in the sniffer?
CC @wp-cli/committers
Seems reasonable to revisit this & implement some tests to ensure that the scaffolded code always passes PHPCS.
Files generated by wp scaffold command are not WordPress coding standard compliant!
For example cpt generated:
https://github.com/wp-cli/wp-cli/issues/4589