Adopt the standard STRTA scaffold (Makefile diverges from the org standard) #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
Makefilediverges from our standard scripts-to-rule-them-all (STRTA) scaffold. Under STRTA, theMakefileis a set of thin shims that delegate toscript/*POSIX-shentrypoints, and CI runsscript/cibuild. The living reference is thenetwatchrepo (Makefile+script/+.gitea/workflows/check.yml); mirror it exactly.Current state (nonconformance)
Makefilehas targetsdefault test build clean tryand no.PHONYdeclaration.testoverlaps a standard target, and it is inline (go test ./... -v), not a shim.bootstrap,setup,lint,fmt,fmt-check,check,docker,hooks(eight).script/directory. No.gitea/workflows/check.yml.Definition of done
Makefilehas a.PHONYdeclaration listing at least the nine standard targets:bootstrap,setup,test,lint,fmt,fmt-check,check,docker,hooks.@script/NAME(testcalls@script/test,hookscalls@script/install-precommit, etc.). Repo-specific extra targets (build,clean,try) are allowed but must not replace the standard shims.script/directory holds executable POSIX-shentrypoints (#!/bin/sh,set -e) forbootstrap,setup,test,lint,fmt,fmt-check,check,docker,install-precommit, pluscibuild.script/checkruns the repo's full local verification (fmt-check+lint+test);script/cibuildis the CI entrypoint (typicallydocker build .), and aDockerfilebuild runsmake checkso the image build fails on any check failure..gitea/workflows/check.ymlis added and invokesscript/cibuild.make checkpasses locally anddocker build .succeeds (green) before the change lands.The finishing commit's title must end with
(closes #N)referencing this issue.Scaffold status: the STRTA scaffold for attrsum is complete and correct on branch
strta-conformance(Makefile as thin shims, fullscript/set includingcibuild, aDockerfilethat runsmake check,.gitea/workflows/check.ymlrunningscript/cibuild, and the standard.golangci.ymlcopied from dnswatcher). Tests andfmt-checkpass, and the branch is pushed so the work is preserved.Blocker on this issue's definition of done (green
make check+docker build): the standard.golangci.yml(default: all, as used by dnswatcher) surfaces 192 pre-existing lint findings in the existingattrsum.go/attrsum_test.go— none introduced by the scaffold. About three quarters are pure style (wsl70,nlreturn40,noinlineerr32); the rest are substantive (errcheck15,gosec3, plus complexity, error-wrapping, and globals). So the new CI/Docker gate would be red from day one until the existing code is remediated.This needs your call on scope, because it also bears on how strict our shared lint standard should be for older/small tools:
.golangci.ymland pair the scaffold with a proper lint-remediation pass over the existing code (I dispatch a code-fix agent; it goes through independent review). Larger, but ends green under the org-standard config. Recommended..golangci.ymltuned to the current code — green immediately, but diverges from the org-standard lint config (the exact kind of divergence this sweep exists to remove).Recommendation: (1). If you agree, I will dispatch the remediation on the same branch and bring it green under the standard config before it lands. Which option do you want?