Skip to content

Instantly share code, notes, and snippets.

@richaber
Created August 1, 2017 22:29
Show Gist options
  • Save richaber/cd97bde46ce14c27f0a0afea279e5dd6 to your computer and use it in GitHub Desktop.
Save richaber/cd97bde46ce14c27f0a0afea279e5dd6 to your computer and use it in GitHub Desktop.
Install WordPress Coding Standards (WPCS), WordPressVIPMinimum, and PHPCompatibility

Install the WordPress Coding Standards (WPCS), WordPressVIPMinimum, and PHPCompatibility sniffs for use with PHPCS.

Install the sniffs, with git, into home dir…

cd ~
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git
git clone https://github.com/Automattic/VIP-Coding-Standards.git
git clone https://github.com/wimg/PHPCompatibility.git

Update PHPCS config to see the sniffs (note that multiple paths require comma, no space, between them, space causes PHPCS to barf)…

phpcs --config-set installed_paths /Users/YOURUSERNAME/WordPress-Coding-Standards,/Users/YOURUSERNAME/VIP-Coding-Standards,/Users/YOURUSERNAME/PHPCompatibility

If you intend to use this for a WP theme, have a look at Underscore's phpcs.xml

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