Skip to content

Instantly share code, notes, and snippets.

@lloc
Created September 21, 2013 12:37
Show Gist options
  • Select an option

  • Save lloc/6650222 to your computer and use it in GitHub Desktop.

Select an option

Save lloc/6650222 to your computer and use it in GitHub Desktop.
Install WordPress Coding Standards for PHP_CodeSniffer in Ubuntu
# Install PHP_CodeSniffer
sudo apt-get install php-codesniffer
# Install the WordPress Coding Standards
sudo git clone git://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git \
$(pear config-get php_dir)/PHP/CodeSniffer/Standards/WordPress
# Now your can check your files like this
phpcs --standard=WordPress your-file.php
# or you could set the WordPress Coding Standards as your default
sudo phpcs --config-set default_standard WordPress
# and use the CodeSniffer like so
phpcs your-file.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment