Compare commits
1 Commits
2389e269ce
...
4d70317d6d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d70317d6d |
17
TODO.md
17
TODO.md
@@ -17,17 +17,19 @@ remaining repo-compliance issues on the tracker.
|
||||
|
||||
# Next Step
|
||||
|
||||
Compliance top-up as one small commit: add `.editorconfig` and add the `hooks`
|
||||
target to the root Makefile.
|
||||
Compliance top-up as one small commit: add an `.editorconfig` at the repo root.
|
||||
`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
|
||||
|
||||
- 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
|
||||
`version: "2"` but used v1 schema keys, so every threshold in it was inert and
|
||||
its green result was meaningless. `make lint` now runs
|
||||
`golangci-lint config verify` first so an invalid config fails the build
|
||||
instead of silently falling back to defaults
|
||||
its green result was meaningless. `backend/Makefile`'s `lint` target now
|
||||
asserts the config's sha256 against the canonical file first, so drift from
|
||||
the org standard fails the build instead of silently degrading to defaults
|
||||
- 2026-07-07 Adopted scripts-to-rule-them-all: `script/` entrypoints, Makefile
|
||||
shims, README Entrypoints section
|
||||
- 2026-02-27: backend with buffered zstd-compressed report storage; CI workflow
|
||||
@@ -49,3 +51,8 @@ target to the root Makefile.
|
||||
green policy)
|
||||
- Decide what to do with untracked resume.sh: commit it, gitignore it, or delete
|
||||
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)
|
||||
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||
SHA256SUM := shasum -a 256
|
||||
else
|
||||
GOFLAGS = -ldflags "-linkmode external -extldflags -static $(GOLDFLAGS)"
|
||||
SHA256SUM := sha256sum
|
||||
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
|
||||
|
||||
all: build
|
||||
@@ -24,11 +34,15 @@ build: ./$(BINARY)
|
||||
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:
|
||||
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 ./...
|
||||
|
||||
fmt:
|
||||
|
||||
@@ -97,9 +97,7 @@ func (s *Server) run() {
|
||||
}
|
||||
|
||||
func (s *Server) serve() int {
|
||||
// Declared up front because the multi-assign below also writes
|
||||
// s.cancelFunc, so := cannot be used.
|
||||
var ctx context.Context //nolint:wsl // see comment above
|
||||
var ctx context.Context
|
||||
|
||||
ctx, s.cancelFunc = context.WithCancel(
|
||||
context.Background(),
|
||||
|
||||
Reference in New Issue
Block a user