build-configs: enable pre-push Git hook
This commit is contained in:
parent
4b42420696
commit
722b7710b4
3 changed files with 32 additions and 0 deletions
7
.githooks/pre-push
Executable file
7
.githooks/pre-push
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
just test-commit
|
|
@ -61,4 +61,5 @@ dockerfile:
|
||||||
|
|
||||||
experimental:
|
experimental:
|
||||||
createGitHubActionsConfiguration: true
|
createGitHubActionsConfiguration: true
|
||||||
|
runGitHooksBeforePush: true
|
||||||
useNewDatabaseCredentials: true
|
useNewDatabaseCredentials: true
|
||||||
|
|
24
justfile
24
justfile
|
@ -29,6 +29,30 @@ install *args:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Enable or disable Git hooks
|
||||||
|
git-hooks command:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
case "{{ command }}" in
|
||||||
|
"on")
|
||||||
|
echo "Enabling Git hooks..."
|
||||||
|
git config core.hooksPath .githooks
|
||||||
|
;;
|
||||||
|
"off")
|
||||||
|
echo "Disabling Git hooks..."
|
||||||
|
git config --unset core.hooksPath
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Error: Invalid argument. Must be either 'on' or 'off'"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
test-commit:
|
||||||
|
just _run php phpcs
|
||||||
|
just _run php phpstan analyze --no-progress --memory-limit=512M
|
||||||
|
just test --testdox --testsuite unit
|
||||||
|
just test --testdox --testsuite kernel
|
||||||
|
|
||||||
_exec +args:
|
_exec +args:
|
||||||
docker compose exec {{ args }}
|
docker compose exec {{ args }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue