Skip to content

chore(lint): add golangci-lint config with depguard rules#713

Open
osvaldoandrade wants to merge 1 commit into
mainfrom
chore/golangci-config
Open

chore(lint): add golangci-lint config with depguard rules#713
osvaldoandrade wants to merge 1 commit into
mainfrom
chore/golangci-config

Conversation

@osvaldoandrade

Copy link
Copy Markdown
Owner

Summary

Adds .golangci.yml with ~30 linters and depguard rules that will enforce layer boundaries as the refactor progresses.

Details

  • depguard rules:
    • internal/core/**: stdlib + pkg/types + pkg/plugin only; blocks database/sql, net/http, gRPC, Gin, Redis, Pebble, Raft.
    • pkg/{types,plugin,auth}/**: blocks any internal/ import.
  • Complexity thresholds: cyclop 10, gocognit 15, funlen 80 lines.
  • Generated code (*.pb.go, *.pb.gw.go) exempt.
  • Test files relaxed (funlen/gocyclo/dupl/gosec).
  • Formatters: gci (with project prefix), gofumpt, goimports.

Rules referencing internal/core and pkg/types/pkg/plugin activate as those packages are created in epics #646 and #647.

Test plan

  • CI runs golangci-lint run and exits cleanly on current codebase.
  • Once internal/core is introduced, an import of net/http from there fails the lint job.

Closes #657
Part of #645

Introduce .golangci.yml with ~30 linters enabled and depguard rules
that will enforce layer boundaries as the refactor progresses:

- internal/core: stdlib + pkg/types only; blocks database/sql, net/http,
  grpc, gin, redis, pebble, raft.
- pkg/types, pkg/plugin, pkg/auth: blocks any internal/ import.

Complexity thresholds: cyclop 10, gocognit 15, funlen 80 lines.
Generated .pb.go files exempt. Test files relaxed.

Refs #645 #657
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.

Add .golangci.yml with depguard rules

1 participant