Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
export PATH=$PATH:~/.composer/vendor/bin
#### WordPress Coding Standards
composer global require "wp-coding-standards/wpcs"
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
phpcs --config-set default_standard WordPress-Extra
@scottoffen

This comment has been minimized.

Copy link

@scottoffen scottoffen commented May 4, 2018

On windows:

phpcs --config-set installed_paths %APPDATA%\Composer\vendor\wp-coding-standards\wpcs
@contactjavas

This comment has been minimized.

Copy link

@contactjavas contactjavas commented Jun 21, 2018

Wow, thank you @scottoffen!

@zoiosilva

This comment has been minimized.

Copy link

@zoiosilva zoiosilva commented Jan 18, 2019

On WSL Ubuntu:

phpcs --config-set installed_paths $HOME/.config/composer/vendor/wp-coding-standards/wpcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment