Skip to content

golint in CI blocks valid generic code; discuss replacement or scoped exclusions #339

@pjsharath28

Description

@pjsharath28

Is your feature request related to a problem?/Why is this needed

The CI lint job currently runs golangci-lint v1.51.2 with golint enabled. While working with generic code (from google/btree here), golint reports warnings that are false positives for generics (receiver naming and exported type name “stuttering”).

I tried the supported golint suppressions (//lint:file-ignore, //lint:ignore, etc.), but they don’t seem to work when golint is run via golangci-lint v1.51. This makes it hard to keep upstream-style generic code without doing API or naming changes just to satisfy the linter.

Describe the solution you'd like in detail

I would like to discuss updating the lint setup so it works better with generics. Possible options could be replacing golint with revive, excluding the specific golint checks that break with generics, or bumping golangci-lint to a newer version.

Happy to follow whatever approach makes sense for the project.

Describe alternatives you've considered

I looked into renaming receivers/types and adding inline golint suppressions, but both approaches either add a lot of churn or don’t work reliably with the current CI setup.

Additional context

golint is deprecated and doesn’t handle generics well, which seems to be the root of the issue. I wanted to raise this for discussion before making code changes.

cc: @dims

Metadata

Metadata

Assignees

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