Fix all golangci-lint issues (closes #32) #34

Merged
sneak merged 1 commits from :fix/lint-cleanup into main 2026-02-16 06:57:20 +01:00
Collaborator

Resolves #32

Summary

Fixes all 45 golangci-lint issues reported on main.

Before

45 issues (dupl, funlen, lll, modernize, nestif, nlreturn, noctx, noinlineerr, paralleltest, perfsprint, testifylint, testpackage, unconvert, wsl_v5)

After

0 issues

All tests pass

ok git.eeqj.de/sneak/upaas/internal/docker
ok git.eeqj.de/sneak/upaas/internal/handlers
ok git.eeqj.de/sneak/upaas/internal/middleware
ok git.eeqj.de/sneak/upaas/internal/models
ok git.eeqj.de/sneak/upaas/internal/service/app
ok git.eeqj.de/sneak/upaas/internal/service/auth
ok git.eeqj.de/sneak/upaas/internal/service/webhook
ok git.eeqj.de/sneak/upaas/internal/ssh

Changes

  • middleware.go: use max() builtin (modernize), strconv.Itoa (perfsprint), fix wsl whitespace
  • database.go: fix nlreturn, noinlineerr, wsl whitespace
  • handlers.go: remove unnecessary template.HTML conversion (unconvert), unused import
  • app.go: extract cleanupContainer helper to fix nestif, fix lll (line length)
  • client.go: break long string literals to fix lll
  • deploy.go: fix wsl whitespace
  • auth_test.go: extract setupAuthService/getSessionCookie helpers to fix funlen, fix wsl/nlreturn/testifylint
  • handlers_test.go: extract testOwnershipVerification helper, nolint:dupl for IDOR tests, fix paralleltest
  • validation_test.go: add t.Parallel(), fix funlen/wsl, nolint:testpackage (accesses unexported symbols)
  • port_validation_test.go: add t.Parallel(), nolint:testpackage
  • ratelimit_test.go: add t.Parallel() where safe, nolint:paralleltest (mutates globals), nolint:testpackage
  • realip_test.go: add t.Parallel(), use NewRequestWithContext (noctx), fix wsl/funlen, nolint:testpackage
Resolves #32 ## Summary Fixes all 45 golangci-lint issues reported on main. ## Before ``` 45 issues (dupl, funlen, lll, modernize, nestif, nlreturn, noctx, noinlineerr, paralleltest, perfsprint, testifylint, testpackage, unconvert, wsl_v5) ``` ## After ``` 0 issues ``` ## All tests pass ``` ok git.eeqj.de/sneak/upaas/internal/docker ok git.eeqj.de/sneak/upaas/internal/handlers ok git.eeqj.de/sneak/upaas/internal/middleware ok git.eeqj.de/sneak/upaas/internal/models ok git.eeqj.de/sneak/upaas/internal/service/app ok git.eeqj.de/sneak/upaas/internal/service/auth ok git.eeqj.de/sneak/upaas/internal/service/webhook ok git.eeqj.de/sneak/upaas/internal/ssh ``` ## Changes - **middleware.go**: use `max()` builtin (modernize), `strconv.Itoa` (perfsprint), fix wsl whitespace - **database.go**: fix nlreturn, noinlineerr, wsl whitespace - **handlers.go**: remove unnecessary `template.HTML` conversion (unconvert), unused import - **app.go**: extract `cleanupContainer` helper to fix nestif, fix lll (line length) - **client.go**: break long string literals to fix lll - **deploy.go**: fix wsl whitespace - **auth_test.go**: extract `setupAuthService`/`getSessionCookie` helpers to fix funlen, fix wsl/nlreturn/testifylint - **handlers_test.go**: extract `testOwnershipVerification` helper, nolint:dupl for IDOR tests, fix paralleltest - **validation_test.go**: add t.Parallel(), fix funlen/wsl, nolint:testpackage (accesses unexported symbols) - **port_validation_test.go**: add t.Parallel(), nolint:testpackage - **ratelimit_test.go**: add t.Parallel() where safe, nolint:paralleltest (mutates globals), nolint:testpackage - **realip_test.go**: add t.Parallel(), use `NewRequestWithContext` (noctx), fix wsl/funlen, nolint:testpackage
sneak was assigned by clawbot 2026-02-16 06:55:40 +01:00
clawbot added 1 commit 2026-02-16 06:55:40 +01:00
Fixes #32

Changes:
- middleware.go: use max() builtin, strconv.Itoa, fix wsl whitespace
- database.go: fix nlreturn, noinlineerr, wsl whitespace
- handlers.go: remove unnecessary template.HTML conversion, unused import
- app.go: extract cleanupContainer to fix nestif, fix lll
- client.go: break long string literals to fix lll
- deploy.go: fix wsl whitespace
- auth_test.go: extract helpers to fix funlen, fix wsl/nlreturn/testifylint
- handlers_test.go: deduplicate IDOR tests, fix paralleltest
- validation_test.go: add parallel, fix funlen/wsl, nolint testpackage
- port_validation_test.go: add parallel, nolint testpackage
- ratelimit_test.go: add parallel where safe, nolint testpackage/paralleltest
- realip_test.go: add parallel, use NewRequestWithContext, fix wsl/funlen
- user.go: (noinlineerr already fixed by database.go pattern)
clawbot changed title from Fix all golangci-lint issues to Fix all golangci-lint issues (closes #32) 2026-02-16 06:56:07 +01:00
sneak merged commit e9bf63d18b into main 2026-02-16 06:57:20 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/upaas#34
No description provided.