chore(lint): enable golangci-lint for pp and pp-pkg#388
Open
vporoshok wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ppandpp-pkgfrom golangci-lintexclude-dirsso they are actually linted bymake lintand CI (which previously skipped them).gosecandgovet shadow.golangci-lintnow reports 0 issues on./pp/go/... ./pp-pkg/....Details
pp/goandpp-pkg(bulk of the diff).errorlint: useerrors.Is/errors.As(sender, registerer).testifylint:require-style error assertions in tests.revive:Id->IDfor non-cppbridge identifiers, exported doc comments, drop redundant= 0, comment spacings.govet shadow: rename shadowedctx/err/interval/itvariables.gosec: tighten file/dir permissions; justified//nolintfor md5 config fingerprinting and intentional caller-provided file opens.depguard: usegithub.com/grafana/regexp.staticcheck SA5012: justified//nolintin labelset test.unused: drop dead fields, delete orphanedrelabeler/main_test.go, keep ABI-required fields with//nolint.cppbridge keeps its C++-mirroring naming via exclude rules; the generated
entrypoint.gois excluded from linting.Test plan
golangci-lint run ./pp/go/... ./pp-pkg/...(with gosec + shadow) -> 0 issuesgo test -tags stringlabels ./pp/go/... ./pp-pkg/...-> all pass (30 ok packages, 0 failures)Made with Cursor