Skip to content

Instantly share code, notes, and snippets.

@BerezhniyDmitro
Created June 14, 2019 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BerezhniyDmitro/3e45f593a6733c5f4943686b7b16e957 to your computer and use it in GitHub Desktop.
Save BerezhniyDmitro/3e45f593a6733c5f4943686b7b16e957 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
STAGED_FILES_CMD=`git show --pretty="" --name-only $CI_COMMIT_SHA --diff-filter=ACMR | grep \\\\.php`
if [ -z "$STAGED_FILES_CMD" ]; then
echo -e '\e[32m Файлов нет, пропускаю.\e[0m';
exit 0;
else
php ./vendor/bin/phpcs --error-severity=1 --warning-severity=8 --colors $STAGED_FILES_CMD
php ./vendor/bin/phpcs --error-severity=1 --warning-severity=8 --colors --report=summary $STAGED_FILES_CMD
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment