Lint's .golangci.yml check says which fix applies (closes #34) #93
@@ -23,6 +23,14 @@ latest run passes.
|
|||||||
|
|
||||||
# Completed Steps
|
# Completed Steps
|
||||||
|
|
||||||
|
- 2026-10-03: `backend/script/lint` says what went wrong with its
|
||||||
|
`.golangci.yml` check (issue #34). On a hash mismatch it says to compare the
|
||||||
|
file with the org standard: if they differ, restore the org standard; if they
|
||||||
|
are the same, the org standard changed, so update `GOLANGCI_CONFIG_SHA256` in
|
||||||
|
that script. It used to say only to restore the file, which loops once the org
|
||||||
|
standard itself has moved. A missing `.golangci.yml`, and a `sha256sum` that
|
||||||
|
is missing or prints no hash, each get their own message instead of being
|
||||||
|
reported as a mismatch; every one still fails the lint
|
||||||
- 2026-10-03: the Go tests run with the race detector and coverage (issue #88):
|
- 2026-10-03: the Go tests run with the race detector and coverage (issue #88):
|
||||||
`backend/script/test` runs `go test -timeout 30s -race -cover ./...` and, if
|
`backend/script/test` runs `go test -timeout 30s -race -cover ./...` and, if
|
||||||
that fails, runs it again with `-v` and fails. Go's `-timeout` bounds the
|
that fails, runs it again with `-v` and fails. Go's `-timeout` bounds the
|
||||||
|
|||||||
+20
-2
@@ -14,16 +14,34 @@ set -eu
|
|||||||
|
|
||||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||||
|
|
||||||
|
# The sha256 of the org standard .golangci.yml. When that file changes in
|
||||||
|
# sneak/prompts and is copied here again, this changes with it.
|
||||||
GOLANGCI_CONFIG_SHA256="a79b63a254602a5318db5d0e9a06bc71b84bf0c1d896305229d8bfed1d1b1776"
|
GOLANGCI_CONFIG_SHA256="a79b63a254602a5318db5d0e9a06bc71b84bf0c1d896305229d8bfed1d1b1776"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
|
if [ ! -f .golangci.yml ]; then
|
||||||
|
echo "backend/.golangci.yml is missing. Copy the org standard verbatim" >&2
|
||||||
|
echo "from https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
actual="$(sha256sum .golangci.yml | cut -d' ' -f1)"
|
actual="$(sha256sum .golangci.yml | cut -d' ' -f1)"
|
||||||
|
if [ -z "$actual" ]; then
|
||||||
|
echo "sha256sum is missing or printed no hash, so" >&2
|
||||||
|
echo "backend/.golangci.yml could not be checked." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ "$actual" != "$GOLANGCI_CONFIG_SHA256" ]; then
|
if [ "$actual" != "$GOLANGCI_CONFIG_SHA256" ]; then
|
||||||
echo ".golangci.yml has drifted from the org standard." >&2
|
echo "backend/.golangci.yml does not match GOLANGCI_CONFIG_SHA256" >&2
|
||||||
|
echo "in backend/script/lint." >&2
|
||||||
echo " expected $GOLANGCI_CONFIG_SHA256" >&2
|
echo " expected $GOLANGCI_CONFIG_SHA256" >&2
|
||||||
echo " actual $actual" >&2
|
echo " actual $actual" >&2
|
||||||
echo "Restore it verbatim from sneak/prompts; do not edit it." >&2
|
echo "Compare it with the org standard," >&2
|
||||||
|
echo "https://git.eeqj.de/sneak/prompts/raw/branch/main/.golangci.yml" >&2
|
||||||
|
echo "- If they differ, it was edited here: restore the org standard" >&2
|
||||||
|
echo " verbatim. Do not edit it." >&2
|
||||||
|
echo "- If they are the same, the org standard changed: set" >&2
|
||||||
|
echo " GOLANGCI_CONFIG_SHA256 in backend/script/lint to the actual hash." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|||||||
Reference in New Issue
Block a user