Skip to content

Commit

Permalink
Fixes acquia#1104: Git pre-commit hook is slow.
Browse files Browse the repository at this point in the history
  • Loading branch information
malikkotob committed Mar 22, 2017
1 parent a0abe07 commit 4b2364a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ fi

echo "Sniffing staged files via PHP Code Sniffer..."
${ROOT_DIR}/vendor/bin/blt validate:phpcs:files -Dfiles="$LIST" -silent -emacs || exit 1;
echo "Linting custom twig files..."
${ROOT_DIR}/vendor/bin/blt validate:twig -silent -emacs || exit 1;
echo "Validating composer.json..."
composer validate --quiet --no-check-all || (echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;)
if [[ $LIST == *".twig"* ]];
then
echo "Linting custom twig files..."
${ROOT_DIR}/vendor/bin/blt validate:twig -silent -emacs || exit 1;
fi
if [[ $LIST == *"composer."* ]];
then
echo "Validating composer.json..."
composer validate --quiet --no-check-all || (echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;)
fi
echo "Ok!"

# Return the status of the last run command.
Expand Down

0 comments on commit 4b2364a

Please sign in to comment.