Fix Go formatting and report validation failures
Homelab Main / validate (push) Failing after 1m13s Details
Homelab Main / running-update (push) Has been skipped Details
Homelab Main / debian-ops (push) Has been skipped Details

This commit is contained in:
juvenal.diaz 2026-11-09 19:25:23 -06:00
parent 6fd2ba622c
commit e879899d90
2 changed files with 7 additions and 2 deletions

View File

@ -57,7 +57,7 @@ var allowedCommands = map[string]bool{
"deploy-ai-tools": true, "deploy-omniroute": true, "deploy-hermes": true,
"rpi-services": true, "host-bootstrap": true, "bootstrap-gitea-repo": true, "repo-sync": true, "backup-gitea": true, "hermes-connect": true,
"network-sandbox": true,
"backup": true, "drill-restore": true, "drill-gitea-restore": true,
"backup": true, "drill-restore": true, "drill-gitea-restore": true,
"drill-pihole-restore": true, "install-gitea-runner": true,
"move-prometheus-stack-workers": true, "doctor-versions": true,
"doctor-edge": true, "doctor-homelab": true, "doctor-gitea": true,

View File

@ -85,7 +85,12 @@ validate_go() {
echo "go not installed; skipping Go checks"
return 0
fi
test -z "$(gofmt -l "${REPO_ROOT}/cmd")"
local unformatted
unformatted="$(gofmt -l "${REPO_ROOT}/cmd")"
if [[ -n "${unformatted}" ]]; then
printf 'Go files require formatting:\n%s\n' "${unformatted}" >&2
return 1
fi
GOCACHE="${GOCACHE:-${REPO_ROOT}/.lab/go-build-cache}" go test ./...
}