tests: run mvdan/shfmt on test runs

While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
This commit is contained in:
Jose Diaz-Gonzalez
2019-01-07 01:04:17 -05:00
parent fb7c73a7e3
commit 86795ddacc
283 changed files with 1536 additions and 1018 deletions

View File

@@ -2,7 +2,8 @@
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
cmd-scheduler-docker-local-report() {
declare desc="displays a scheduler-docker-local report for one or more apps"
@@ -45,7 +46,8 @@ cmd-scheduler-docker-local-report-single() {
dokku_log_verbose "$(printf "%-30s %-25s" "${key^}" "${flag#*: }")"
done
else
local match=false; local value_exists=false
local match=false
local value_exists=false
for flag in "${flag_map[@]}"; do
valid_flags="${valid_flags} $(echo "$flag" | cut -d':' -f1)"
if [[ "$flag" == "${INFO_FLAG}:"* ]]; then
@@ -65,14 +67,14 @@ cmd-scheduler-docker-local-report-single() {
scheduler_docker_local_help_content_func() {
declare desc="return scheduler-docker-local plugin help content"
cat<<help_content
cat <<help_content
scheduler-docker-local:report [<app>] [<flag>], Displays a scheduler-docker-local report for one or more apps
scheduler-docker-local:set <app> <property> (<value>), Set or clear a scheduler-docker-local property for an app
help_content
}
cmd-scheduler-docker-local-help() {
if [[ $1 = "scheduler-docker-local:help" ]] ; then
if [[ $1 == "scheduler-docker-local:help" ]]; then
echo -e 'Usage: dokku scheduler-docker-local[:COMMAND]'
echo ''
echo 'Manages the scheduler-docker-local integration for an app.'
@@ -83,7 +85,7 @@ cmd-scheduler-docker-local-help() {
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
scheduler_docker_local_help_content_func
else
cat<<help_desc
cat <<help_desc
scheduler-docker-local, Manages the scheduler-docker-local integration for an app
help_desc
fi
@@ -92,7 +94,7 @@ help_desc
fn-scheduler-docker-local-retire-container() {
declare APP="$1" CID="$2" DEAD_TIME="$3"
if ! docker inspect "${CID}" > /dev/null; then
if ! docker inspect "${CID}" >/dev/null; then
return
fi
@@ -104,8 +106,8 @@ fn-scheduler-docker-local-retire-container() {
# on to the next.
# shellcheck disable=SC2086
docker stop $DOCKER_STOP_TIME_ARG "$CID" \
|| docker kill "$CID" \
|| dokku_log_warn "Unable to kill container ${CID}"
|| docker kill "$CID" \
|| dokku_log_warn "Unable to kill container ${CID}"
if ! docker kill "$CID"; then
dokku_log_warn "Unable to kill container ${CID}"
@@ -119,5 +121,5 @@ fn-scheduler-docker-local-register-retired-container() {
CURRENT_TIME="$(date +%s)"
DEAD_TIME=$((CURRENT_TIME + WAIT))
echo "${APP} ${CID} ${DEAD_TIME}" >> "${DEAD_CONTAINER_FILE}"
echo "${APP} ${CID} ${DEAD_TIME}" >>"${DEAD_CONTAINER_FILE}"
}