Files
Marijn d1d1eb3a24 docs: update README and add pre-commit hook (#173)
* docs: replace requirements with developer and deployment guide

* docs: add CI badge, disclaimer, contributing guide, and license

* docs: fix and expand disclaimer based on legal review

* docs: clarify test vs dev fixture commands in testing section

* feat: add pre-commit hook for staged-file quality checks

Adds a versioned .githooks/pre-commit script that runs Rector,
PHP-CS-Fixer, and PHPStan on staged PHP files, and Twig-CS-Fixer on
staged Twig files. Auto-fixes are re-staged before PHPStan runs.
Falls back to docker compose run --rm when the PHP service is not up.

Install with: just install-hooks

* chore: switch pre-commit hook shebang from bash to zsh
2026-07-03 15:05:29 +00:00

64 lines
1.8 KiB
Makefile

up *args:
docker compose up -d {{ args }}
down *args:
docker compose down --remove-orphans {{ args }}
stop:
docker compose stop
exec *args:
docker compose exec php {{ args }}
[no-exit-message]
shell:
@docker compose exec php bash
[no-exit-message]
shell-run:
@docker compose run --rm php bash
migrate: up
docker compose run --rm php bin/console doctrine:migrations:migrate --no-interaction
fixtures:
docker compose exec php bin/console doctrine:fixtures:load --purge-with-truncate --no-interaction --group=dev
translations:
docker compose exec php bin/console translation:extract --force --format=xliff --sort=asc nl
fix-cs:
docker compose exec php vendor/bin/php-cs-fixer fix
docker compose exec php vendor/bin/twig-cs-fixer fix
rector *args:
docker compose exec php vendor/bin/rector {{ args }}
phpstan *args:
docker compose exec php vendor/bin/phpstan analyse {{ args }}
test *args:
docker compose exec php vendor/bin/phpunit {{ args }}
[confirm]
clean:
docker compose down -v --remove-orphans
rm -rf vendor var assets/vendor public/assets public/bundles .php-cs-fixer.cache .twig-cs-fixer.cache
reload-tests:
@docker compose exec php bin/console --env=test doctrine:database:drop --if-exists --force
@docker compose exec php bin/console --env=test doctrine:database:create
@docker compose exec php bin/console --env=test doctrine:migrations:migrate -n
@docker compose exec php bin/console --env=test doctrine:fixtures:load -n --group=test
install-hooks:
git config core.hooksPath .githooks
chmod +x .githooks/pre-commit
@echo "Pre-commit hook installed."
trust-cert:
sudo security add-trusted-cer -d \
-r trustRoot \
-k "$HOME/Library/Keychains/login.keychain" \
./frankenphp/data/caddy/pki/authorities/local/root.crt