Harden read-only provider with tests, docs, and CI

This commit is contained in:
beatz174-bit
2026-04-21 14:39:36 +10:00
parent cf47a6ed48
commit 6cc1b206dc
24 changed files with 711 additions and 246 deletions
+13 -6
View File
@@ -1,14 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
echo "[check] Running gofmt"
echo "[check] verifying gofmt"
files="$(git ls-files '*.go')"
if [[ -n "$files" ]]; then
# shellcheck disable=SC2086
gofmt -w $files
if [[ -n "${files}" ]]; then
unformatted="$(gofmt -l ${files})"
if [[ -n "${unformatted}" ]]; then
echo "[check][error] gofmt reported unformatted files:" >&2
echo "${unformatted}" >&2
exit 1
fi
fi
echo "[check] Running go test"
echo "[check] running go vet"
go vet ./...
echo "[check] running go test"
go test ./...
echo "[check] Completed"
echo "[check] complete"