Skip to content

Instantly share code, notes, and snippets.

@deepakaryan1988
Created November 10, 2017 11:07
Show Gist options
  • Save deepakaryan1988/53a72bb8b211b0f0445d06562ce601a9 to your computer and use it in GitHub Desktop.
Save deepakaryan1988/53a72bb8b211b0f0445d06562ce601a9 to your computer and use it in GitHub Desktop.
Install PHPCS and use the Drupal Coding Standard from the coder module.
; cd into the directory you store code resources.
cd ~
; Clone PHP_CodeSniffer directly from the github repo.
; You could also install via pear.
git clone [email protected]:squizlabs/PHP_CodeSniffer.git
; Clone the coder branch you want.
; Currently 7.x-2.x has the latest for D7
git clone --branch 7.x-2.x http://git.drupal.org/project/coder.git
; Add the Drupal coding standard to PHPCS.
; Symlink to the Drupal coding standard in the coder module from within
; the PHPCS standards directory.
cd ~/PHP_CodeSniffer/CodeSniffer/Standards/
ln -s ~/coder/coder_sniffer/Drupal/ Drupal
; Get the full path to the phpcs script inorder to configure NetBeans.
cd ~/PHP_CodeSniffer/scripts/
echo $PWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment