Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Resolves #679: Twig validation hook fails. #680

Merged
merged 1 commit into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions phing/tasks/validate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,4 @@
<exec dir="${repo.root}" command="${composer.bin}/blt-console lint:twig ${repo.root} ${docroot}/modules/custom ${docroot}/themes/custom" logoutput="true" checkreturn="true" passthru="true" level="${blt.exec_level}" />
</target>

<target name="validate:twig:files" description="Validates twig syntax on custom twig files.">
<fail unless="files" message="Missing files parameter."/>
<exec dir="${repo.root}" command="${composer.bin}/blt-console lint:twig ${repo.root} ${files}" logoutput="true" checkreturn="true" passthru="true" level="${blt.exec_level}" />
</target>

</project>
7 changes: 4 additions & 3 deletions scripts/git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ 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 staged twig files..."
${ROOT_DIR}/vendor/bin/blt validate:twig: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 -q || echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;
composer validate -q || (echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;)
echo "Ok!"

# Return the status of the last run command.
exit $?