Add comments to functions

This commit is contained in:
Oliver Davies 2024-07-20 13:56:04 +01:00
parent 97836712f2
commit ac8246704e

View file

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