diff --git a/templates/php/drupal/run.twig b/templates/php/drupal/run.twig index ab2bc51..c083d7b 100755 --- a/templates/php/drupal/run.twig +++ b/templates/php/drupal/run.twig @@ -44,11 +44,13 @@ function cmd { } {% if not php.phpcs is same as false %} +# Run coding standards checks. function coding-standards { cmd phpcs "${@}" } {% endif %} +# Execute any Composer command. function composer { _exec php composer "${@}" } @@ -60,14 +62,17 @@ function db { docker compose exec database mysql -u"$DB_USER" -p"$DB_PASSWORD" "$DB_NAME" } +# Execute any Drush command. function drush { _exec php drush "${@}" } +# Disable Git hooks. function git-hooks:off { git config --unset core.hooksPath } +# Enable Git hooks. function git-hooks:on { git config core.hooksPath .githooks } @@ -86,12 +91,14 @@ function install { drush site:install -y "${@}" } +# Lint the Dockerfile. function lint:dockerfile { docker container run --rm -i \ hadolint/hadolint hadolint --ignore DL3008 --ignore DL3022 --ignore DL3059 -t style "${@}" - < Dockerfile } {% if not php.phpcs is same as false and not php.phpstan is same as false %} +# Run code quality checks. function quality { {% if not php.phpcs is same as false %} coding-standards @@ -102,6 +109,7 @@ function quality { } {% endif %} +# Start the project. function start { cp -v --no-clobber .env.example .env || true