amitaibu / og

A fork to work on OG8
https://github.com/Gizra/og
29 stars 16 forks source link

Add code sniffer to OG #249

Closed RoySegall closed 8 years ago

amitaibu commented 8 years ago

Please do, it's great.

amitaibu commented 8 years ago

We can also have a local run_coder.sh script that will do something like:

phpcs --standard=Drupal -p --colors --extensions=php,module,inc,install,test,profile,theme,js,css,info  $ROOT

if [ $? -ne 0 ]; then
  # If there was an error try to fix it, and re-run PHPCS.

  echo
  echo "$Autofixing errors, and re-running PHPCS"
  echo

  phpcbf --standard=Drupal -p --colors --extensions=php,module,inc,install,test,profile,theme,js,css,info $ROOT
  phpcs --standard=Drupal -p --colors --extensions=php,module,inc,install,test,profile,theme,js,css,info $ROOT
fi
amitaibu commented 8 years ago

or maybe it doesn't make sense that each contrib module will add their own script. Anyway, for now lets go with the travis one.

RoySegall commented 8 years ago

do you want this as a git hook maybe?