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

Commit 0f546a1

Browse files
authored
Resolves #676: Twig validation hook fails. (#680)
1 parent cd7ed29 commit 0f546a1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

phing/tasks/validate.xml

-5
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,4 @@
9090
<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}" />
9191
</target>
9292

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

scripts/git-hooks/pre-commit

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ fi
1212

1313
echo "Sniffing staged files via PHP Code Sniffer..."
1414
${ROOT_DIR}/vendor/bin/blt validate:phpcs:files -Dfiles="$LIST" -silent -emacs || exit 1;
15-
echo "Linting staged twig files..."
16-
${ROOT_DIR}/vendor/bin/blt validate:twig:files -Dfiles="$LIST" -silent -emacs || exit 1;
15+
echo "Linting custom twig files..."
16+
${ROOT_DIR}/vendor/bin/blt validate:twig -silent -emacs || exit 1;
1717
echo "Validating composer.json..."
18-
composer validate -q || echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;
18+
composer validate -q || (echo 'composer.json is not valid. Run `composer validate` for more information.' && exit 1;)
19+
echo "Ok!"
1920

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

0 commit comments

Comments
 (0)