Remediate all lint findings and make CI green (closes #1) #3
Reference in New Issue
Block a user
Delete Branch "lint-remediation"
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?
Follow-up to the STRTA scaffold (landed in PR #2): fixes all ~192 pre-existing golangci-lint findings under the standard
.golangci.ymland makes the CI/Docker gate genuinely green, closing #1.Lint remediation (behavior-preserving)
gochecknoglobals(4): replaced package globals with anoptionsstruct threaded through the commands (also makesparalleltestsafe).err113(4): package-level sentinel errors, wrapped with%w.errcheck(15): every previously-unchecked error is now checked or explicitly discarded.forbidigo(5): verbose output viafmt.Fprintf(os.Stdout, …).noinlineerr/wsl/nlreturn/gofmt(~142): mechanical, mostly--fix.cyclop/gocognit/nestif): small behavior-preserving helper extractions.mnd,lll,nonamedreturns,revive,modernize,nilnil,thelper,paralleltest): named constants, wrapped lines, doc comments,t.Helper()/t.Parallel(), etc.//nolint:gosec // G304:os.Open(path)where the operator-named path IS the intended input (verified false positive).Two environment fixes so the tests actually run in CI (not skipped)
berlin.sneak.app.attrsum.*to theuser.*namespace (user.berlin.sneak.app.attrsum.checksum/…sumtime). Linux only permitsuser.*/trusted.*/security.*/system.*xattrs on regular files (the old keys returnedEOPNOTSUPP); macOS treats the name as opaque, so behavior there is unchanged. README key table updated. NOTE: this is an intentional, owner-approved on-disk key rename — files summed under the old keys won't be recognized under the new keys.make check(andmake build) as an unprivilegedbuilderuser, soTestPermissionErrors(expectingEACCESon a0000file) is meaningful rather than bypassed by root.Verification
make checkanddocker build .(in-imagemake checkunder the pinned golangci-lint v2.10.1) are both green: all 6 tests pass,0 issues.make testandmake fmt-checkpass. Behavior preserved.Merged to
mainafter an independent adversarial review (reviewer separate from the author). The reviewer traced every refactor against the original control flow and found no behavior change (theoptions-struct threading, the extracted helpers, sentinel errors, and errcheck fixes are all semantics-preserving), confirmed theuser.*xattr rename is applied consistently on every read/write/check/clear path with the README updated, verified the non-root Docker build genuinely exercisesTestPermissionErrorsasbuilder, and confirmed the single//nolint:gosec // G304is the only nolint and a real false positive. Re-randocker build .:0 issuesunder the pinned golangci-lint and 6/6 tests pass as non-root. Hygiene and scope clean. Verdict: PASS. attrsum'smake check/docker buildare now green.