Compare commits
1 Commits
2389e269ce
...
feat/golan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d70317d6d |
17
TODO.md
17
TODO.md
@@ -17,17 +17,19 @@ remaining repo-compliance issues on the tracker.
|
|||||||
|
|
||||||
# Next Step
|
# Next Step
|
||||||
|
|
||||||
Compliance top-up as one small commit: add `.editorconfig` and add the `hooks`
|
Compliance top-up as one small commit: add an `.editorconfig` at the repo root.
|
||||||
target to the root Makefile.
|
`backend/.editorconfig` exists but the root has none. (The `hooks` target this
|
||||||
|
step used to also name is already present in both the root `Makefile` and
|
||||||
|
`backend/Makefile`.)
|
||||||
|
|
||||||
# Completed Steps
|
# Completed Steps
|
||||||
|
|
||||||
- 2026-08-09: adopted the org-standard `backend/.golangci.yml` verbatim and
|
- 2026-08-09: adopted the org-standard `backend/.golangci.yml` verbatim and
|
||||||
bumped the pinned golangci-lint to v2.12.2; the previous config declared
|
bumped the pinned golangci-lint to v2.12.2; the previous config declared
|
||||||
`version: "2"` but used v1 schema keys, so every threshold in it was inert and
|
`version: "2"` but used v1 schema keys, so every threshold in it was inert and
|
||||||
its green result was meaningless. `make lint` now runs
|
its green result was meaningless. `backend/Makefile`'s `lint` target now
|
||||||
`golangci-lint config verify` first so an invalid config fails the build
|
asserts the config's sha256 against the canonical file first, so drift from
|
||||||
instead of silently falling back to defaults
|
the org standard fails the build instead of silently degrading to defaults
|
||||||
- 2026-07-07 Adopted scripts-to-rule-them-all: `script/` entrypoints, Makefile
|
- 2026-07-07 Adopted scripts-to-rule-them-all: `script/` entrypoints, Makefile
|
||||||
shims, README Entrypoints section
|
shims, README Entrypoints section
|
||||||
- 2026-02-27: backend with buffered zstd-compressed report storage; CI workflow
|
- 2026-02-27: backend with buffered zstd-compressed report storage; CI workflow
|
||||||
@@ -49,3 +51,8 @@ target to the root Makefile.
|
|||||||
green policy)
|
green policy)
|
||||||
- Decide what to do with untracked resume.sh: commit it, gitignore it, or delete
|
- Decide what to do with untracked resume.sh: commit it, gitignore it, or delete
|
||||||
it
|
it
|
||||||
|
- Upstream fix needed in `sneak/prompts`: the org-standard `.golangci.yml`
|
||||||
|
enables `gomodguard`, which golangci-lint v2.12.2 reports as deprecated since
|
||||||
|
v2.12.0 and replaced by `gomodguard_v2`, so every backend lint run prints a
|
||||||
|
deprecation warning. The file is standardized and must never be edited in this
|
||||||
|
repo, so nothing can be done here beyond tracking it
|
||||||
|
|||||||
@@ -8,10 +8,20 @@ GOLDFLAGS += -X main.Buildarch=$(BUILDARCH)
|
|||||||
|
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||||
|
SHA256SUM := shasum -a 256
|
||||||
else
|
else
|
||||||
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
|
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
|
||||||
|
SHA256SUM := sha256sum
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# .golangci.yml is standardized org-wide and must never be edited here
|
||||||
|
# (REPO_POLICIES.md). Its last silent drift replaced the v2 schema with
|
||||||
|
# v1 keys, which left every threshold in the file inert while the build
|
||||||
|
# stayed green. The lint target therefore asserts the file still matches
|
||||||
|
# the canonical copy byte for byte. The check is a local hash comparison:
|
||||||
|
# no network, no remote schema, nothing unpinned in the build path.
|
||||||
|
GOLANGCI_CONFIG_SHA256 := 021cc83f4e6fc7c31b95b34b846723dfcf20b66b7baeea1dc40406e643346bcb
|
||||||
|
|
||||||
.PHONY: all build test lint fmt fmt-check check docker hooks run clean
|
.PHONY: all build test lint fmt fmt-check check docker hooks run clean
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
@@ -24,11 +34,15 @@ build: ./$(BINARY)
|
|||||||
test:
|
test:
|
||||||
timeout 30 go test ./...
|
timeout 30 go test ./...
|
||||||
|
|
||||||
# `config verify` is run first so that a .golangci.yml which does not
|
|
||||||
# validate against the golangci-lint schema fails the build instead of
|
|
||||||
# silently falling back to default thresholds.
|
|
||||||
lint:
|
lint:
|
||||||
golangci-lint config verify
|
@actual=$$($(SHA256SUM) .golangci.yml | cut -d' ' -f1); \
|
||||||
|
if [ "$$actual" != "$(GOLANGCI_CONFIG_SHA256)" ]; then \
|
||||||
|
echo ".golangci.yml has drifted from the org standard."; \
|
||||||
|
echo " expected $(GOLANGCI_CONFIG_SHA256)"; \
|
||||||
|
echo " actual $$actual"; \
|
||||||
|
echo "Restore it verbatim from sneak/prompts; do not edit it."; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
|
|||||||
@@ -97,9 +97,7 @@ func (s *Server) run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) serve() int {
|
func (s *Server) serve() int {
|
||||||
// Declared up front because the multi-assign below also writes
|
var ctx context.Context
|
||||||
// s.cancelFunc, so := cannot be used.
|
|
||||||
var ctx context.Context //nolint:wsl // see comment above
|
|
||||||
|
|
||||||
ctx, s.cancelFunc = context.WithCancel(
|
ctx, s.cancelFunc = context.WithCancel(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
|
|||||||
Reference in New Issue
Block a user