Skip to content

Instantly share code, notes, and snippets.

@cocoastorm
Last active January 3, 2019 20:42
Show Gist options
  • Save cocoastorm/080669cd1763a04a7bcb53214c80a8ba to your computer and use it in GitHub Desktop.
Save cocoastorm/080669cd1763a04a7bcb53214c80a8ba to your computer and use it in GitHub Desktop.
PHP_CodeSniffer Docker Git Hook
#!/bin/sh
# replace the docker image, if you want
PHPCS_IMAGE=khoanguyent/codesniff
if [ -f "phpcs.xml" ]; then
echo "Running PHPCS in Docker\n"
docker run --rm -v $PWD:/data/src \
${PHPCS_IMAGE} \
/bin/sh -c 'cd /data/src; phpcs .'
exit $?
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment