Skip to content

Instantly share code, notes, and snippets.

@rezzz-dev
Created January 7, 2016 14:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save rezzz-dev/cb4b1c681ae06e936996 to your computer and use it in GitHub Desktop.
Save rezzz-dev/cb4b1c681ae06e936996 to your computer and use it in GitHub Desktop.
PHP Code Sniffer with WordPress Coding Standards and Atom
#Install PHP CodeSniffer
brew install homebrew/php/php-code-sniffer #if using Homebrew
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs #if you want to do it directly
#Install WordPress Coding Standards
git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
#Add WordPress standards to PHPCS config
phpcs -i #shows the libraries installed
phpcs --config-set installed_paths <path to dir that you cloned>/wpcs
"linter-phpcs":
executablePath: "/usr/local/bin/phpcs"
codeStandardOrConfigFile: "WordPress"
tabWidth: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment