TomodomoCo / acf-color-picker-palette

Color picker palette for ACF
MIT License
1 stars 0 forks source link

Fix WP Coding Standards violations #2

Open timothyjensen opened 6 years ago

timothyjensen commented 6 years ago

This plugin was originally forked from the ACF Field Type Template, which was a great starting point, but it introduced a very unique (uncommon) coding style. I would like to see this plugin conform to the WordPress Coding Standards for two main reasons:

  1. These coding standards are becoming more widely implemented, which means developers will gradually become more familiar with the style. Consistency is a good thing.
  2. Code editors/IDEs can be set up to alert of PHPCS/WPCS violations, but when the alerts are numerous they have the effect of muting more serious problems. Fixing the existing WP Coding Standards violations will make it easier to identify more severe problems.
chrisvanpatten commented 6 years ago

I think it'd be nice to make this a bigger @TomodomoCo push to get some basic style linting in place. My preference is something editor-agnostic, e.g. a composer-integrated tool like so: https://github.com/DealerDirect/phpcodesniffer-composer-installer

timothyjensen commented 6 years ago

It's actually fairly simple to set up Codesniffer; you just add a couple lines to the require-devsection of composer.json (related: #3). A good example is

https://github.com/GaryJones/genesis-js-no-js/blob/3c6bdc9216ab14b76ada67a89ea10a3f9e72afdb/composer.json#L36-L38