Commit 5909f59
ci: install golangci-lint (Tier-2 quality) (#133)
* ci: install golangci-lint (Tier-2 quality)
Adds golangci-lint workflow + conservative initial config to surface
Go code-quality issues (errcheck, ineffassign, gocyclo, unused, staticcheck, misspell).
Runs on PR + push-to-master + weekly schedule. Sibling-checkout pattern
matches existing codeql.yml for replace-directive resolution.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(golangci-lint): bump action v6 → v8 + migrate config to v2 (Go 1.25)
Action v6 resolved to golangci-lint v1.64.8 (built with Go 1.24), which
fails to load configs targeting Go 1.25. Action v8 ships golangci-lint
v2.x which is Go 1.25-compatible.
Config migrated to v2 format: removed gosimple (folded into staticcheck),
moved exclude-rules under linters.exclusions, added version: "2" header.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(golangci-lint): baseline gocyclo threshold + targeted staticcheck exclusions
- gocyclo min-complexity 20 -> 69: ratchet baseline just above the largest
pre-existing offender (StackHandler.New, complexity 68) so introducing the
linter does not force 33 risky production-handler refactors. Lower over time.
- Exclude SA1019 in MinIO provider (local-dev-only; deprecated-API swap is
behavior-risky on the credential path).
- Exclude QF1001 in resource.go (De Morgan on two SQL-injection identifier
guards; inverting security boolean logic mechanically is unsafe).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(golangci-lint): fix ineffassign, unused, and safe staticcheck issues
ineffassign (2):
- auth.go emitAuthLoginAudit: drop ineffectual email clone (never read in bg goroutine)
- mongo_test.go: remove dead first token assignment overwritten on next line
unused (3): removed genuinely-dead code with no test references:
- handlers-pkg readBody, presignOKEnvelope, capNetBindService const
staticcheck (28, all behavior-preserving):
- QF1002 admin_customers.go: switch{case x==""} -> switch x {case ""}
- S1016 email_webhooks.go / export_bvwave_test.go / export_test.go: struct-literal copy -> type conversion
- QF1008 internal_backup_refund.go / middleware/auth.go / crypto+razorpaybilling tests: drop embedded-field selectors
- S1008 magic_link.go: collapse to return strings.Contains(...)
- S1039 isolation_test.go: drop obsolete fmt.Sprint keep-import hack
- QF1003 idempotency_fingerprint_test.go: if/else-if -> tagged switch
- S1005 deployment_failure_test.go: drop unnecessary blank identifier
- QF1001 cli_auth_coverage_test.go: De Morgan (test assertion, not a security guard)
- QF1012 auth_final2_test / auth_oauth_coverage_test: Write([]byte(Sprintf)) -> Fprintf
- SA5001 admin_promos_audit_residual_test.go: check sqlmock err before defer Close
- SA9003 provisioner/client_cov_test.go: empty branch -> _ = br.Allow()
- QF1011 run_test.go: omit redundant func() error type (inferred from run)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci(golangci-lint): fix all 90 errcheck issues + final QF1001 reduction
errcheck (90, behavior-preserving):
- 71 deferred closers (rows.Close / resp.Body.Close / stream.Close / *.Shutdown
across handlers/models/providers/email/main.go/testhelpers):
defer X.Close() -> defer func() { _ = X.Close() }()
- manual post-loop / scan-error-path rows.Close() in admin_customers.go and
admin_promo_codes.go: assigned to _ ('result set fully consumed')
- idempotency.go fingerprint-hash f.Close(): assigned to _ (read-only)
- stack.go tarball-read f.Close() after io.ReadAll: assigned to _ (in memory)
- k8s/client.go extractTarGz write f.Close(): assigned to _ (best-effort, loop continues)
- queue/local.go NATS health-check resp.Body.Close(): assigned to _ (StatusCode only)
- app_github_connection.go tx.Rollback(): defer func() { _ = tx.Rollback() }()
(the prior em-dash //nolint form was not a valid directive)
- testhelpers cleanup closures: db.Close / rdb.Close / app.Shutdown assigned to _
staticcheck: cli_auth_coverage_test.go QF1001 rewritten as an explicit isHex
bool so staticcheck no longer suggests further De Morgan reduction.
golangci-lint run --timeout=5m -> 0 issues. go build ./... + go vet ./... clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d14c2af commit 5909f59
60 files changed
Lines changed: 235 additions & 173 deletions
File tree
- .github/workflows
- internal
- crypto
- email
- handlers
- middleware
- models
- providers
- compute/k8s
- db
- nosql
- queue
- provisioner
- razorpaybilling
- testhelpers
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
| 484 | + | |
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
| 490 | + | |
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
| 512 | + | |
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
548 | | - | |
| 548 | + | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
759 | | - | |
| 758 | + | |
| 759 | + | |
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | | - | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
524 | 525 | | |
525 | 526 | | |
526 | 527 | | |
527 | | - | |
| 528 | + | |
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| |||
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
544 | | - | |
| 545 | + | |
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
| |||
668 | 669 | | |
669 | 670 | | |
670 | 671 | | |
671 | | - | |
| 672 | + | |
672 | 673 | | |
673 | 674 | | |
674 | 675 | | |
| |||
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
720 | | - | |
| 721 | + | |
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
| |||
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
751 | | - | |
| 752 | + | |
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
0 commit comments