forked from bazel-contrib/bazel-gazelle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not generate an empty rule if a go_proto_library was already gener… (
bazel-contrib#1927) **What type of PR is this?** > Bug fix **What package or component does this PR mostly affect?** > language/go **What does this PR do? Why is it needed?** Prevents overwriting of a generated `go_proto_library` in the case where the package name matches the proto file name. See issue for more details. **Which issues(s) does this PR fix?** Fixes bazel-contrib#1926 **Other notes for review** Unclear exactly how to write a test for it, but did local testing at least.
- Loading branch information
1 parent
293a67e
commit 27bbbc6
Showing
12 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# gazelle:proto file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# gazelle:proto file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Fix go_proto_library dependencies | ||
|
||
Fix go_proto_library dependencies when package and proto name match |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") | ||
load("@rules_proto//proto:defs.bzl", "proto_library") | ||
|
||
proto_library( | ||
name = "example_proto", | ||
srcs = ["example.proto"], | ||
visibility = ["//visibility:public"], | ||
deps = ["//google/type:type_proto"], | ||
) | ||
|
||
proto_library( | ||
name = "other_proto", | ||
srcs = ["other.proto"], | ||
visibility = ["//visibility:public"], | ||
deps = ["//google/type:type_proto"], | ||
) | ||
|
||
go_proto_library( | ||
name = "example_go_proto", | ||
importpath = "github.com/bazelbuild/bazel-gazelle/fix_package_proto_name_match/example/example", | ||
proto = ":example_proto", | ||
visibility = ["//visibility:public"], | ||
deps = ["//google/type:date_proto"], | ||
) | ||
|
||
go_proto_library( | ||
name = "other_go_proto", | ||
importpath = "github.com/bazelbuild/bazel-gazelle/fix_package_proto_name_match/example/other", | ||
proto = ":other_proto", | ||
visibility = ["//visibility:public"], | ||
deps = ["//google/type:date_proto"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
syntax = "proto3"; | ||
|
||
package proto.example.example; | ||
|
||
option go_package = "github.com/bazelbuild/bazel-gazelle/fix_package_proto_name_match/example/example"; | ||
|
||
import "google/type/date.proto"; | ||
|
||
message Example { | ||
google.type.Date date = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
package proto.example.other; | ||
|
||
option go_package = "github.com/bazelbuild/bazel-gazelle/fix_package_proto_name_match/example/other"; | ||
|
||
import "google/type/date.proto"; | ||
|
||
message Other { | ||
google.type.Date date = 1; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters