From e55fe652c11e2acbcf37d2f94d4f4e1ec528b267 Mon Sep 17 00:00:00 2001 From: bufdev Date: Thu, 12 Sep 2024 11:43:09 -0400 Subject: [PATCH 1/4] Add buf-plugin-aep Signed-off-by: bufdev --- cmd/buf-plugin-aep/main.go | 175 +++++++++++++++++++++++++++++++++++++ go.mod | 31 ++++--- go.sum | 67 +++++++++----- 3 files changed, 243 insertions(+), 30 deletions(-) create mode 100644 cmd/buf-plugin-aep/main.go diff --git a/cmd/buf-plugin-aep/main.go b/cmd/buf-plugin-aep/main.go new file mode 100644 index 0000000..6f9de53 --- /dev/null +++ b/cmd/buf-plugin-aep/main.go @@ -0,0 +1,175 @@ +package main + +import ( + "context" + "errors" + "fmt" + "log" + "strings" + + "buf.build/go/bufplugin/check" + "github.com/aep-dev/api-linter/lint" + "github.com/aep-dev/api-linter/rules" + "github.com/jhump/protoreflect/desc" + "google.golang.org/protobuf/reflect/protoreflect" +) + +const ( + aepCategoryID = "AEP" + aepCoreCategoryID = "AEP_CORE" +) + +type fileDescriptorsContextKey struct{} + +func main() { + spec, err := newSpec() + if err != nil { + log.Fatalln(err) + } + // AEP rules cannot be run in parallel as there is thread-unsafe code in + // this repository that causes concurrent read and write access to a map. + check.Main(spec, check.MainWithParallelism(1)) +} + +func newSpec() (*check.Spec, error) { + ruleRegistry := lint.NewRuleRegistry() + if err := rules.Add(ruleRegistry); err != nil { + return nil, err + } + ruleSpecs := make([]*check.RuleSpec, 0, len(ruleRegistry)) + for _, protoRule := range ruleRegistry { + ruleSpec, err := newRuleSpec(protoRule) + if err != nil { + return nil, err + } + ruleSpecs = append(ruleSpecs, ruleSpec) + } + return &check.Spec{ + Rules: ruleSpecs, + Categories: []*check.CategorySpec{ + { + ID: aepCategoryID, + Purpose: "Checks all API Improvement proposals as specified at https://aep.dev.", + }, + { + ID: aepCoreCategoryID, + Purpose: "Checks all core API Improvement proposals as specified at https://aep.dev.", + }, + }, + Before: before, + }, nil +} + +func newRuleSpec(protoRule lint.ProtoRule) (*check.RuleSpec, error) { + ruleName := protoRule.GetName() + if !ruleName.IsValid() { + return nil, fmt.Errorf("lint.RuleName is invalid: %q", ruleName) + } + + split := strings.Split(string(ruleName), "::") + if len(split) != 3 { + return nil, fmt.Errorf("unknown lint.RuleName format, expected three parts split by '::' : %q", ruleName) + } + categoryIDs := []string{aepCategoryID} + switch extraCategoryID := split[0]; extraCategoryID { + case "core": + categoryIDs = append(categoryIDs, aepCoreCategoryID) + default: + return nil, fmt.Errorf("unknown lint.RuleName format: unknown category %q : %q", extraCategoryID, ruleName) + } + + // The allowed characters for RuleName are a-z, 0-9, -. + // The separator :: is also allowed. + // We do a translation of these into valid check.Rule IDs. + ruleID := "AEP_" + strings.Join(split[1:3], "_") + ruleID = strings.ReplaceAll(ruleID, "-", "_") + ruleID = strings.ToUpper(ruleID) + + return &check.RuleSpec{ + ID: ruleID, + CategoryIDs: categoryIDs, + Default: true, + Purpose: fmt.Sprintf("Checks AEP rule %s.", ruleName), + Type: check.RuleTypeLint, + Handler: newRuleHandler(protoRule), + }, nil +} + +func newRuleHandler(protoRule lint.ProtoRule) check.RuleHandler { + return check.RuleHandlerFunc( + func(ctx context.Context, responseWriter check.ResponseWriter, request check.Request) error { + fileDescriptors, _ := ctx.Value(fileDescriptorsContextKey{}).([]*desc.FileDescriptor) + for _, fileDescriptor := range fileDescriptors { + for _, problem := range protoRule.Lint(fileDescriptor) { + if err := addProblem(responseWriter, problem); err != nil { + return err + } + } + } + return nil + }, + ) +} + +func addProblem(responseWriter check.ResponseWriter, problem lint.Problem) error { + addAnnotationOptions := []check.AddAnnotationOption{ + check.WithMessage(problem.Message), + } + descriptor := problem.Descriptor + if descriptor == nil { + // This should never happen. + return errors.New("got nil problem.Descriptor") + } + fileDescriptor := descriptor.GetFile() + if fileDescriptor == nil { + // If we do not have a FileDescriptor, we cannot report a location. + responseWriter.AddAnnotation(addAnnotationOptions...) + return nil + } + // If a location is available from the problem, we use that directly. + if location := problem.Location; location != nil { + addAnnotationOptions = append( + addAnnotationOptions, + check.WithFileNameAndSourcePath( + fileDescriptor.GetName(), + protoreflect.SourcePath(location.GetPath()), + ), + ) + } else { + // Otherwise we check the source info for the descriptor from the problem. + if location := descriptor.GetSourceInfo(); location != nil { + addAnnotationOptions = append( + addAnnotationOptions, + check.WithFileNameAndSourcePath( + fileDescriptor.GetName(), + protoreflect.SourcePath(location.GetPath()), + ), + ) + } + } + responseWriter.AddAnnotation(addAnnotationOptions...) + return nil +} + +func before(ctx context.Context, request check.Request) (context.Context, check.Request, error) { + fileDescriptors, err := nonImportFileDescriptorsForFiles(request.Files()) + if err != nil { + return nil, nil, err + } + ctx = context.WithValue(ctx, fileDescriptorsContextKey{}, fileDescriptors) + return ctx, request, nil +} + +func nonImportFileDescriptorsForFiles(files []check.File) ([]*desc.FileDescriptor, error) { + if len(files) == 0 { + return nil, nil + } + reflectFileDescriptors := make([]protoreflect.FileDescriptor, 0, len(files)) + for _, file := range files { + if file.IsImport() { + continue + } + reflectFileDescriptors = append(reflectFileDescriptors, file.FileDescriptor()) + } + return desc.WrapFiles(reflectFileDescriptors) +} diff --git a/go.mod b/go.mod index 8545183..bf3c33f 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,13 @@ module github.com/aep-dev/api-linter -go 1.20 +go 1.21 + +toolchain go1.23.1 require ( bitbucket.org/creachadair/stringset v0.0.12 buf.build/gen/go/aep/api/protocolbuffers/go v1.34.2-20240329195937-b433450cc52f.2 + buf.build/go/bufplugin v0.2.0 cloud.google.com/go/longrunning v0.5.6 github.com/bmatcuk/doublestar/v4 v4.6.1 github.com/gertd/go-pluralize v0.2.1 @@ -15,20 +18,28 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stoewer/go-strcase v1.3.0 google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 - google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v2 v2.4.0 ) require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240221180331-f05a6f4403ce.2 // indirect - github.com/bufbuild/protocompile v0.8.0 // indirect + buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.34.2-20240904181154-a0be11449112.2 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 // indirect + buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.34.2-20240828222655-5345c0a56177.2 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect + github.com/bufbuild/protocompile v0.14.1 // indirect + github.com/bufbuild/protovalidate-go v0.6.5 // indirect github.com/golang/protobuf v1.5.4 // indirect + github.com/google/cel-go v0.21.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/grpc v1.62.1 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.0 // indirect + pluginrpc.com/pluginrpc v0.3.0 // indirect ) diff --git a/go.sum b/go.sum index 7bd0d5a..2a76fcb 100644 --- a/go.sum +++ b/go.sum @@ -2,27 +2,47 @@ bitbucket.org/creachadair/stringset v0.0.12 h1:APD8dIoAzGv70a6p1oasPDjPwkp+ajszd bitbucket.org/creachadair/stringset v0.0.12/go.mod h1:KtNk2s0hRO1T0r78lv9Zq/S/Lp0du2zI0Fj5j5Y4LDo= buf.build/gen/go/aep/api/protocolbuffers/go v1.34.2-20240329195937-b433450cc52f.2 h1:0Ka0tKxAfSnJm9sVa7RVtnkTZ8DeTjuNhfHdk0ruLZ8= buf.build/gen/go/aep/api/protocolbuffers/go v1.34.2-20240329195937-b433450cc52f.2/go.mod h1:7GnupzUM4BaoyPcUUTZZwrcVZvCBNcyn6iR/kddRTuU= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240221180331-f05a6f4403ce.2 h1:Vs037OPnb+uCAQrDAxeGOM8UWvIBhET3hx+ZePssyrQ= -buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240221180331-f05a6f4403ce.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw= +buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.34.2-20240904181154-a0be11449112.2 h1:X9qBPcvWGOJs/CeRVLoxxLJwC/eKyWDS/G4nj+3KGMY= +buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.34.2-20240904181154-a0be11449112.2/go.mod h1:B+9TKHRYqoAUW57pLjhkLOnBCu0DQYMV+f7imQ9nXwI= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2 h1:SZRVx928rbYZ6hEKUIN+vtGDkl7uotABRWGY4OAg5gM= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.34.2-20240717164558-a6c49f84cc0f.2/go.mod h1:ylS4c28ACSI59oJrOdW4pHS4n0Hw4TgSPHn8rpHl4Yw= +buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.34.2-20240828222655-5345c0a56177.2 h1:oSi+Adw4xvIjXrW8eY8QGR3sBdfWeY5HN/RefnRt52M= +buf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.34.2-20240828222655-5345c0a56177.2/go.mod h1:GjH0gjlY/ns16X8d6eaXV2W+6IFwsO5Ly9WVnzyd1E0= +buf.build/go/bufplugin v0.2.0 h1:nnNvWzUgQXitRDmjWWIkuXj9klreAAE94sVCsL+0v5g= +buf.build/go/bufplugin v0.2.0/go.mod h1:ZZYGt6PDcjbBSywdz/G8NdXkIuWi2rzR8CduGzbCPdk= cloud.google.com/go/longrunning v0.5.6 h1:xAe8+0YaWoCKr9t1+aWe+OeQgN/iJK1fEgZSXmjuEaE= cloud.google.com/go/longrunning v0.5.6/go.mod h1:vUaDrWYOMKRuhiv6JBnn49YxCPz2Ayn9GqyjaBT8/mA= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bufbuild/protocompile v0.8.0 h1:9Kp1q6OkS9L4nM3FYbr8vlJnEwtbpDPQlQOVXfR+78s= -github.com/bufbuild/protocompile v0.8.0/go.mod h1:+Etjg4guZoAqzVk2czwEQP12yaxLJ8DxuqCJ9qHdH94= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= +github.com/bufbuild/protovalidate-go v0.6.5 h1:WucDKXIbK22WjkO8A8J6Yyxxy0jl91Oe9LSMduq3YEE= +github.com/bufbuild/protovalidate-go v0.6.5/go.mod h1:LHDiGCWSM3GagZEnyEZ1sPtFwi6Ja4tVTi/DCc+iDFI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= +github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= github.com/gertd/go-pluralize v0.2.1/go.mod h1:rbYaKDbsXxmRfr8uygAEKhOWsjyrrqrkHVpZvoOp8zk= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI= +github.com/google/cel-go v0.21.0/go.mod h1:rHUlWCcBKgyEk+eV03RPdZUekPp6YcJwV0FxuUksYxc= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/jhump/protoreflect v1.15.6 h1:WMYJbw2Wo+KOWwZFvgY0jMoVHM6i4XIvRs2RcBj5VmI= github.com/jhump/protoreflect v1.15.6/go.mod h1:jCHoyYQIJnaabEYnbGwyo9hUqfyUMTbJw/tAut5t97E= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lithammer/dedent v1.1.0 h1:VNzHMVCBNG1j0fh3OrsFRkVUwStdDArbgBWoPAffktY= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -39,29 +59,36 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 h1:ImUcDPHjTrAqNhlOkSocDLfG9rrNHH7w7uoKWPaWZ8s= google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7/go.mod h1:/3XmxOjePkvmKrHuBy4zNFw7IzxJXtAgdpXi8Ll990U= -google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs= -google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= +google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +pluginrpc.com/pluginrpc v0.3.0 h1:9BSGRIdNLf/+EU3JrkISLwgIAuYxBrMEzSfNyeQ/Gp0= +pluginrpc.com/pluginrpc v0.3.0/go.mod h1:UNWZ941hcVAoOZUn8YZsMmOZBzbUjQa3XMns8RQLp9o= From 0bf3a35992c18d2757200c37e0a8bc93892d8e09 Mon Sep 17 00:00:00 2001 From: bufdev <4228796+bufdev@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:40:45 -0400 Subject: [PATCH 2/4] Update cmd/buf-plugin-aep/main.go Co-authored-by: Richard Frankel --- cmd/buf-plugin-aep/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/buf-plugin-aep/main.go b/cmd/buf-plugin-aep/main.go index 6f9de53..48143d1 100644 --- a/cmd/buf-plugin-aep/main.go +++ b/cmd/buf-plugin-aep/main.go @@ -49,7 +49,7 @@ func newSpec() (*check.Spec, error) { Categories: []*check.CategorySpec{ { ID: aepCategoryID, - Purpose: "Checks all API Improvement proposals as specified at https://aep.dev.", + Purpose: "Checks all API Enhancement proposals as specified at https://aep.dev.", }, { ID: aepCoreCategoryID, From 0a08fea5a43fefe514f6d86dc4c198f8024485a2 Mon Sep 17 00:00:00 2001 From: bufdev <4228796+bufdev@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:40:50 -0400 Subject: [PATCH 3/4] Update cmd/buf-plugin-aep/main.go Co-authored-by: Richard Frankel --- cmd/buf-plugin-aep/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/buf-plugin-aep/main.go b/cmd/buf-plugin-aep/main.go index 48143d1..8816ce9 100644 --- a/cmd/buf-plugin-aep/main.go +++ b/cmd/buf-plugin-aep/main.go @@ -53,7 +53,7 @@ func newSpec() (*check.Spec, error) { }, { ID: aepCoreCategoryID, - Purpose: "Checks all core API Improvement proposals as specified at https://aep.dev.", + Purpose: "Checks all core API Enhancement proposals as specified at https://aep.dev.", }, }, Before: before, From 5573a082a671a60398a92a59770feb9f0835b9b6 Mon Sep 17 00:00:00 2001 From: bufdev Date: Fri, 13 Sep 2024 16:45:39 -0400 Subject: [PATCH 4/4] Fix up CI --- .github/workflows/ci.yaml | 8 ++++---- .github/workflows/release.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9a7b67f..7531359 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: 1.23.x - run: go test -p 1 ./... lint: runs-on: ubuntu-latest @@ -19,9 +19,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: 1.23.x - name: staticcheck - uses: dominikh/staticcheck-action@v1.3.0 + uses: dominikh/staticcheck-action@v1 with: version: "2022.1.1" quality-checker: @@ -30,6 +30,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: 1.23.x - name: Run the quality checker (which catches obvious mistakes, missing docs, etc.) run: go run ./.github/quality-checker diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fbe0737..684d562 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version: 1.23.x # The API linter does not use these, but we need them to build the # binaries. #