Last active
January 3, 2019 20:42
-
-
Save cocoastorm/080669cd1763a04a7bcb53214c80a8ba to your computer and use it in GitHub Desktop.
PHP_CodeSniffer Docker Git Hook
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
#!/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