scaffold-command icon indicating copy to clipboard operation
scaffold-command copied to clipboard

wp scaffold and WPCS

Open sandrodz opened this issue 6 years ago • 12 comments

Files generated by wp scaffold command are not WordPress coding standard compliant!

For example cpt generated:

screen shot 2017-12-22 at 3 39 29 pm

https://github.com/wp-cli/wp-cli/issues/4589

sandrodz avatar Dec 22 '17 14:12 sandrodz

Close via https://github.com/wp-cli/scaffold-command/pull/110

gitlost avatar Jan 08 '18 21:01 gitlost

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...

gitlost avatar Jan 08 '18 21:01 gitlost

@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 avatar Jan 12 '18 09:01 gziolo

@gziolo No, but that would be a good addition. I'll create an issue for that.

schlessera avatar Jan 12 '18 10:01 schlessera

Awesome, thanks 🙇

gziolo avatar Jan 12 '18 10:01 gziolo

to keep track what else needs work

  • [ ] wp scaffold _s
  • [x] wp scaffold block -- marking as complete ( i couldn't find any errors )
  • [x] wp scaffold child-theme
  • [ ] wp scaffold plugin
  • [ ] wp scaffold plugin-tests
  • [x] wp scaffold post-type
  • [x] wp scaffold taxonomy
  • [x] wp scaffold theme-tests

@gitlost @schlessera @gziolo I am checking commands I did that were merged

@gziolo you fixed scaffold block right?

thrijith avatar Jan 16 '18 21:01 thrijith

Good idea @thrijith !

gitlost avatar Jan 16 '18 23:01 gitlost

Going to remove this from the 1.1.2 milestone as incomplete at this late stage...

gitlost avatar Jan 27 '18 20:01 gitlost

@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.

gziolo avatar Jan 28 '18 19:01 gziolo

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.

NicktheGeek avatar Jul 20 '18 13:07 NicktheGeek