Skip to content

Commit 8f3cf59

Browse files
committed
Remove obsolete fixer
1 parent a972ace commit 8f3cf59

File tree

3 files changed

+2
-50
lines changed

3 files changed

+2
-50
lines changed

cmd/gazelle/integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,15 +761,15 @@ service TestService {}
761761
Content: `
762762
load("@rules_proto//proto:defs.bzl", "proto_library")
763763
load("@io_bazel_rules_go//go:def.bzl", "go_library")
764-
load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library")
764+
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
765765
766766
proto_library(
767767
name = "repo_proto",
768768
srcs = ["foo.proto"],
769769
visibility = ["//visibility:public"],
770770
)
771771
772-
go_grpc_library(
772+
go_proto_library(
773773
name = "repo_go_proto",
774774
importpath = "example.com/repo",
775775
proto = ":repo_proto",

language/go/fix.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
func (*goLang) Fix(c *config.Config, f *rule.File) {
2828
migrateLibraryEmbed(c, f)
29-
migrateGrpcCompilers(c, f)
3029
flattenSrcs(c, f)
3130
squashCgoLibrary(c, f)
3231
squashXtest(c, f)
@@ -171,18 +170,6 @@ func migrateLibraryEmbed(c *config.Config, f *rule.File) {
171170
}
172171
}
173172

174-
// migrateGrpcCompilers converts "go_proto_library" rules with a "compilers"
175-
// attribute containing exactly oldGrpcCompilerLabel into "go_grpc_library" rules.
176-
func migrateGrpcCompilers(c *config.Config, f *rule.File) {
177-
for _, r := range f.Rules {
178-
if r.Kind() != "go_proto_library" || r.ShouldKeep() || r.Attr("compilers") == nil || len(r.AttrStrings("compilers")) != 1 || !strListAttrContains(r, "compilers", oldGrpcCompilerLabel) {
179-
continue
180-
}
181-
r.SetKind("go_grpc_library")
182-
r.DelAttr("compilers")
183-
}
184-
}
185-
186173
// squashCgoLibrary removes cgo_library rules with the default name and
187174
// merges their attributes with go_library with the default name. If no
188175
// go_library rule exists, a new one will be created.

language/go/fix_test.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -551,41 +551,6 @@ gomock(
551551
package = "main",
552552
source = "stripe.go",
553553
)
554-
`,
555-
},
556-
// migrateGrpcCompilers tests
557-
{
558-
desc: "go_proto_library with grpc compilers migrated to go_grpc_library",
559-
old: `load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library")
560-
561-
proto_library(
562-
name = "foo_proto",
563-
srcs = ["foo.proto"],
564-
visibility = ["//visibility:public"],
565-
)
566-
567-
go_proto_library(
568-
name = "foo_go_proto",
569-
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
570-
importpath = "example.com/repo",
571-
proto = ":foo_proto",
572-
visibility = ["//visibility:public"],
573-
)
574-
`,
575-
want: `load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library")
576-
577-
proto_library(
578-
name = "foo_proto",
579-
srcs = ["foo.proto"],
580-
visibility = ["//visibility:public"],
581-
)
582-
583-
go_grpc_library(
584-
name = "foo_go_proto",
585-
importpath = "example.com/repo",
586-
proto = ":foo_proto",
587-
visibility = ["//visibility:public"],
588-
)
589554
`,
590555
},
591556
// flattenSrcs tests

0 commit comments

Comments
 (0)