Skip to content

Turn the mechanical kit linters back on #1152

Description

@mariusvniekerk

Turn these kit checks back on in .golangci.overlay.yml and make make lint-check pass. They are disabled under linters.disable on the lint-policy branch (PR #1146). A fresh custom-gcl run with them forced on reports 75 findings, almost all in internal/server/api_test.go.

Done when those names are gone from linters.disable, nolintlint.allow-unused can go back off if no stale //nolint remains, and make lint-check is clean.

unconvert (48)

All in internal/server/api_test.go. They are nested conversions such as Number: int64(int64(prNumber)) on generated-client calls (example: line 2566). Delete the inner conversion. Do not rewrite this with a text replace of int64(int64(; that leaves a spare ) and does not compile.

thelper (11)

Helpers that take *testing.T and do not start with t.Helper():

  • internal/server/api_test.go (6), including setupTestServerWithRepos
  • internal/server/e2etest/labels_provider_test.go:221 and :555
  • internal/server/host_check_test.go:26
  • internal/server/kata/test_helpers_test.go:101 and :111

usestdlibvars (6)

All in internal/server/api_test.go. String status codes "200", "404", "405", "409", "500" that should be http.StatusOK and the matching constants. Lines 1640, 1670, 11127, 11724, 14804, 14827.

perfsprint (5)

  • internal/gitclone/commit_stats.go:70: fmt.Errorf with no formatting, use errors.New
  • internal/server/api_test.go:1699, :3677, :11766: same
  • internal/server/api_test.go:17584: fmt.Sprintf of an integer, use strconv.Itoa

mirror (2)

internal/server/api_test.go:28285 and :28420. (*strings.Builder).Write instead of the allocating mirror call.

gocritic (3)

  • internal/server/api_test.go:28747: exitAfterDefer, os.Exit skips defer cancel()
  • internal/workspace/localruntime/manager_test.go:2961 and :2980: appendAssign, append result is not assigned back to the same slice

Kit already disables the filepath-join gocritic check. Do not turn that back on.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions