Skip to content

Commit

Permalink
Use third_party Gazelle dependency instead of workspace Gazelle depen…
Browse files Browse the repository at this point in the history
…dency (#61)

#60 did not succeed in fixing #59 because source depended on the WORKSPACE-declared gazelle version instead of the go.mod declared gazelle version. In addition to moving the dependency to match go.mod, add test coverage for the defect described in #59 to ensure resolution.
  • Loading branch information
mark-thm authored May 3, 2023
1 parent 1341a10 commit 4a95fe9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion driver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
"//cli",
"//pkg",
"//third_party/protobuf/bazel/analysis",
"@bazel_gazelle//label:go_default_library",
"@com_github_bazelbuild_bazel_gazelle//label",
],
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ go_library(
"//common/sorted_set",
"//third_party/protobuf/bazel/analysis",
"//third_party/protobuf/bazel/build",
"@bazel_gazelle//label:go_default_library",
"@com_github_aristanetworks_goarista//path",
"@com_github_bazelbuild_bazel_gazelle//label",
"@com_github_wi2l_jsondiff//:jsondiff",
"@org_golang_google_protobuf//encoding/protojson",
"@org_golang_google_protobuf//proto",
Expand All @@ -38,7 +38,7 @@ go_test(
"//common",
"//third_party/protobuf/bazel/analysis",
"//third_party/protobuf/bazel/build",
"@bazel_gazelle//label:go_default_library",
"@com_github_bazelbuild_bazel_gazelle//label",
"@com_github_otiai10_copy//:copy",
"@org_golang_google_protobuf//proto",
],
Expand Down
16 changes: 16 additions & 0 deletions pkg/target_determinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,19 @@ func Test_stringSliceContainsStartingWith(t *testing.T) {
})
}
}

func Test_ParseCanonicalLabel(t *testing.T) {
for _, tt := range []string{
"@//label",
"@//label:package",
"//label:package",
"label:package",
":package",
"@rules_python~0.21.0~pip~pip_boto3//:pkg",
} {
_, err := ParseCanonicalLabel(tt)
if err != nil {
t.Errorf("ParseCanonicalLabel() with (label=%s) produces error %s", tt, err)
}
}
}
2 changes: 1 addition & 1 deletion target-determinator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ go_library(
"//cli",
"//pkg",
"//third_party/protobuf/bazel/analysis",
"@bazel_gazelle//label:go_default_library",
"@com_github_bazelbuild_bazel_gazelle//label",
],
)

Expand Down

0 comments on commit 4a95fe9

Please sign in to comment.