Skip to content

Commit

Permalink
chore: replace v1 proto-go with v2 (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz authored Jan 2, 2024
1 parent b40c90d commit 818992c
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmd/api-linter/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"strings"
"sync"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/internal"
"github.com/googleapis/api-linter/lint"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/desc/protoparse"
"github.com/spf13/pflag"
"google.golang.org/protobuf/proto"
dpb "google.golang.org/protobuf/types/descriptorpb"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
cloud.google.com/go/longrunning v0.5.2
github.com/bmatcuk/doublestar/v4 v4.6.1
github.com/gertd/go-pluralize v0.2.1
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.6.0
github.com/jhump/protoreflect v1.15.3
github.com/lithammer/dedent v1.1.0
Expand All @@ -23,6 +22,7 @@ require (

require (
github.com/bufbuild/protocompile v0.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion lint/problem.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package lint
import (
"encoding/json"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// Problem contains information about a result produced by an API Linter.
Expand Down
2 changes: 1 addition & 1 deletion lint/problem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"strings"
"testing"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc/builder"
dpb "google.golang.org/protobuf/types/descriptorpb"
"gopkg.in/yaml.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion lint/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"regexp"
"strings"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// ProtoRule defines a lint rule that checks Google Protobuf APIs.
Expand Down
2 changes: 1 addition & 1 deletion lint/rule_enabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package lint
import (
"strings"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// defaultDisabledRules is the list of rules or groups that are by default
Expand Down
2 changes: 1 addition & 1 deletion lint/rule_enabled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package lint
import (
"testing"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/desc/builder"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

func TestRuleIsEnabled(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion locations/descriptor_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package locations

import (
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// DescriptorName returns the precise location for a descriptor's name.
Expand Down
2 changes: 1 addition & 1 deletion locations/field_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
package locations

import (
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
apb "google.golang.org/genproto/googleapis/api/annotations"
"google.golang.org/protobuf/reflect/protoreflect"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// FieldOption returns the precise location for the given extension defintion on
Expand Down
2 changes: 1 addition & 1 deletion locations/file_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package locations

import (
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
apb "google.golang.org/genproto/googleapis/api/annotations"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// FileSyntax returns the location of the syntax definition in a file descriptor.
Expand Down
2 changes: 1 addition & 1 deletion locations/file_locations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package locations
import (
"testing"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/google/go-cmp/cmp"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/desc/builder"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

func TestLocations(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion locations/locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
package locations

import (
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// pathLocation returns the precise location for a given descriptor and path.
Expand Down
2 changes: 1 addition & 1 deletion locations/message_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package locations

import (
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
apb "google.golang.org/genproto/googleapis/api/annotations"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// MessageResource returns the precise location of the `google.api.resource`
Expand Down
2 changes: 1 addition & 1 deletion locations/method_locations.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package locations

import (
lrpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
apb "google.golang.org/genproto/googleapis/api/annotations"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

// MethodRequestType returns the precise location of the method's input type.
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0123/duplicate_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
"sort"
"strings"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/locations"
"github.com/googleapis/api-linter/rules/internal/utils"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

type resourceDef struct {
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0123/resource_pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"fmt"
"strings"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/locations"
"github.com/googleapis/api-linter/rules/internal/utils"
"github.com/jhump/protoreflect/desc"
"google.golang.org/genproto/googleapis/api/annotations"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

var resourcePattern = &lint.MessageRule{
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0123/resource_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"fmt"
"strings"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/locations"
"github.com/googleapis/api-linter/rules/internal/utils"
"github.com/jhump/protoreflect/desc"
"google.golang.org/genproto/googleapis/api/annotations"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

var resourceVariables = &lint.MessageRule{
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0191/file_option_consistency.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"sort"
"strconv"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/locations"
"github.com/jhump/protoreflect/desc"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

var consistentOptions = map[string]func(*dpb.FileOptions) string{
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0191/file_option_consistency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
"sort"
"testing"

dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/rules/internal/testutils"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/desc/builder"
"github.com/stoewer/go-strcase"
"google.golang.org/protobuf/proto"
dpb "google.golang.org/protobuf/types/descriptorpb"
)

func TestFileOptionConsistency(t *testing.T) {
Expand Down

0 comments on commit 818992c

Please sign in to comment.