Last active
December 23, 2017 08:35
-
-
Save komlenic/543b6f5893d129502c97 to your computer and use it in GitHub Desktop.
Installing drupal code standards in vim + syntastic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This assumes you already have installed vim, and syntastic (and of course php). | |
# Download the Drupal coder module. You could do this via other methods but git is nice. | |
# You can place this wherever, but take note of where you placed it. Something like | |
# /usr/local/src might be good. | |
git clone --branch 8.x-2.x http://git.drupal.org/project/coder.git | |
# Install php code sniffer (phpcs). Using pear. | |
pear install PHP_CodeSniffer | |
# Test if phpcs was installed correctly. | |
phpcs --version | |
# Tell phpcs where the Drupal coding standards live. | |
ln -sv /path/to/coder/coder_sniffer/Drupal $(pear config-get php_dir)/PHP/CodeSniffer/Standards | |
# Add this line to .vimrc. | |
let g:syntastic_php_phpcs_args = " --standard=Drupal --extensions=php,module,inc,install,test,profile,theme" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment