Skip to content

chore(lint): enable golangci-lint for pp and pp-pkg#388

Open
vporoshok wants to merge 1 commit into
ppfrom
chore/golangci-lint-pp-dirs
Open

chore(lint): enable golangci-lint for pp and pp-pkg#388
vporoshok wants to merge 1 commit into
ppfrom
chore/golangci-lint-pp-dirs

Conversation

@vporoshok

Copy link
Copy Markdown
Collaborator

Summary

  • Remove pp and pp-pkg from golangci-lint exclude-dirs so they are actually linted by make lint and CI (which previously skipped them).
  • Enable gosec and govet shadow.
  • Resolve all resulting findings; golangci-lint now reports 0 issues on ./pp/go/... ./pp-pkg/....

Details

  • gofumpt/goimports formatting across pp/go and pp-pkg (bulk of the diff).
  • errorlint: use errors.Is/errors.As (sender, registerer).
  • testifylint: require-style error assertions in tests.
  • revive: Id->ID for non-cppbridge identifiers, exported doc comments, drop redundant = 0, comment spacings.
  • govet shadow: rename shadowed ctx/err/interval/it variables.
  • gosec: tighten file/dir permissions; justified //nolint for md5 config fingerprinting and intentional caller-provided file opens.
  • depguard: use github.com/grafana/regexp.
  • staticcheck SA5012: justified //nolint in labelset test.
  • unused: drop dead fields, delete orphaned relabeler/main_test.go, keep ABI-required fields with //nolint.

cppbridge keeps its C++-mirroring naming via exclude rules; the generated entrypoint.go is excluded from linting.

Test plan

  • golangci-lint run ./pp/go/... ./pp-pkg/... (with gosec + shadow) -> 0 issues
  • go test -tags stringlabels ./pp/go/... ./pp-pkg/... -> all pass (30 ok packages, 0 failures)

Made with Cursor

Remove pp/pp-pkg from golangci-lint exclude-dirs so they are actually
linted by `make lint` (and CI), and enable gosec and govet shadow.

Resolve all resulting findings:
- gofumpt/goimports formatting across pp/go and pp-pkg
- errorlint: use errors.Is/As (sender, registerer)
- testifylint: require-error for error assertions in tests
- revive: var-naming Id->ID for non-cppbridge identifiers, exported
  doc comments, drop redundant `= 0`, comment spacings
- govet shadow: rename shadowed ctx/err/interval/it variables
- gosec: tighten file/dir permissions, justified nolint for md5
  config fingerprinting and intentional file opens
- depguard: use github.com/grafana/regexp
- staticcheck SA5012: justified nolint in labelset test
- unused: drop dead fields, delete orphaned relabeler/main_test.go,
  keep ABI-required fields with nolint

cppbridge keeps C++-mirroring naming via exclude rules; the generated
entrypoint.go is excluded from linting.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant