internal/handlers/handlers_test.go: secret, main (2 findings)
internal/docker/validation_test.go: main (1 finding)
Remediation: extract package-level (or test-file-level) constants with
meaningful names — e.g. template data keys (App, Error) in
handlers, header names and branch fixtures in tests. Where the same
literal appears in both app.go and api.go/webhook_events.go,
share one constant in the handlers package rather than duplicating.
Definition of done:
make lint (golangci-lint ≥ 2.12) reports zero goconst findings
no //nolint directives added; no behavior change
make test passes; make fmt run before commit
TODO.md updated per the repo workflow
lands via PR from a feature branch off main
Surveyed 2026-08-07: golangci-lint 2.12.2 reports 24 `goconst`
findings on `main` — repeated string literals that should be named
constants. Breakdown:
Production code (10):
- `internal/handlers/app.go`: `error` (14×), `App` (8×), `status`
(6×), `Error` (5×), `logs` (4×)
- `internal/handlers/webhook_events.go`: `App` (8×)
- `internal/handlers/setup.go`: `Error` (5×)
- `internal/handlers/api.go`: `error` (14×)
Test code (14):
- `internal/service/app/app_test.go`: repo URL fixtures (2 findings)
- `internal/service/webhook/webhook_test.go`: `main`, `X-Gitea-Event`,
`X-GitHub-Event`, `Push Hook` (4 findings)
- `internal/middleware/realip_test.go`: IP fixtures (6 findings)
- `internal/middleware/ratelimit_test.go`: `10.0.0.1:1234` (1 finding)
- `internal/handlers/handlers_test.go`: `secret`, `main` (2 findings)
- `internal/docker/validation_test.go`: `main` (1 finding)
Remediation: extract package-level (or test-file-level) constants with
meaningful names — e.g. template data keys (`App`, `Error`) in
handlers, header names and branch fixtures in tests. Where the same
literal appears in both `app.go` and `api.go`/`webhook_events.go`,
share one constant in the `handlers` package rather than duplicating.
Definition of done:
- `make lint` (golangci-lint ≥ 2.12) reports zero `goconst` findings
- no `//nolint` directives added; no behavior change
- `make test` passes; `make fmt` run before commit
- `TODO.md` updated per the repo workflow
- lands via PR from a feature branch off `main`
clawbot
added this to the 1.1.0 milestone 2026-08-07 18:40:49 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Surveyed 2026-08-07: golangci-lint 2.12.2 reports 24
goconstfindings on
main— repeated string literals that should be namedconstants. Breakdown:
Production code (10):
internal/handlers/app.go:error(14×),App(8×),status(6×),
Error(5×),logs(4×)internal/handlers/webhook_events.go:App(8×)internal/handlers/setup.go:Error(5×)internal/handlers/api.go:error(14×)Test code (14):
internal/service/app/app_test.go: repo URL fixtures (2 findings)internal/service/webhook/webhook_test.go:main,X-Gitea-Event,X-GitHub-Event,Push Hook(4 findings)internal/middleware/realip_test.go: IP fixtures (6 findings)internal/middleware/ratelimit_test.go:10.0.0.1:1234(1 finding)internal/handlers/handlers_test.go:secret,main(2 findings)internal/docker/validation_test.go:main(1 finding)Remediation: extract package-level (or test-file-level) constants with
meaningful names — e.g. template data keys (
App,Error) inhandlers, header names and branch fixtures in tests. Where the same
literal appears in both
app.goandapi.go/webhook_events.go,share one constant in the
handlerspackage rather than duplicating.Definition of done:
make lint(golangci-lint ≥ 2.12) reports zerogoconstfindings//nolintdirectives added; no behavior changemake testpasses;make fmtrun before commitTODO.mdupdated per the repo workflowmainclawbot referenced this issue2026-09-03 18:29:27 +02:00
clawbot referenced this issue2026-09-03 18:29:58 +02:00