Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:
files=$(gofmt -l .) && echo $files && [ -z "$files" ]

- name: Golang CI Lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.0.1
version: v2.1.6
args: --timeout 10m

unit-tests:
Expand Down
51 changes: 51 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: "2"
linters:
enable:
- bodyclose
- containedctx
- contextcheck
- errorlint
- goconst
- godot
- importas
- nilerr
- promlinter
- revive
- sloglint
- testifylint
- unparam
- usestdlibvars
settings:
importas:
alias:
- pkg: ^k8s\.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)$
alias: $1$2
revive:
rules:
- name: exported
exclusions:
generated: lax
paths:
- generated.*\.go$
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- goimports
settings:
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/qdrant) # Custom section: groups all imports with the specified Prefix (our company, but our own component).
- prefix(github.com/qdrant/qdrant-cloud-buf-plugin/) # Custom section: groups all imports with the specified Prefix (this component).
exclusions:
generated: lax
paths:
- generated.*\.go$
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
GCI = $(LOCALBIN)/gci

## Tool Versions
GOLANGCI_LINT_VERSION ?= v2.0.1
GOLANGCI_LINT_VERSION ?= v2.1.6
GCI_VERSION ?= v0.13.5

.PHONY: bootstrap
Expand Down
4 changes: 2 additions & 2 deletions cmd/buf-plugin-required-fields/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func getRequiredEntityFields(request check.Request) ([]string, error) {

// extractEntityNames returns a set of entity names inferred from the name of
// the service methods.
// e.g: [ListBooks, GetBook] -> {Book}
// e.g: [ListBooks, GetBook] -> {Book}.
func extractEntityNames(fileDescriptor descriptor.FileDescriptor) map[string]struct{} {
entityNames := make(map[string]struct{})
services := fileDescriptor.FileDescriptorProto().GetService()
Expand All @@ -152,7 +152,7 @@ func extractEntityNames(fileDescriptor descriptor.FileDescriptor) map[string]str
return entityNames
}

// inferEntityFromMethodName extracts the entity name by stripping CRUD prefixes
// inferEntityFromMethodName extracts the entity name by stripping CRUD prefixes.
func inferEntityFromMethodName(methodName string) string {
p := pluralize.NewClient()
for _, prefix := range crudMethodPrefixes {
Expand Down
Loading