Fix Go formatting and report validation failures
This commit is contained in:
parent
6fd2ba622c
commit
e879899d90
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 ./...
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue