Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/gazelle: hack to fix repository name hfor @go_googleapis #717

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cmd/gazelle/fix-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,20 @@ func removeLegacyGoRepository(f *rule.File) {
}

func findWorkspaceName(f *rule.File) string {
var name string
for _, r := range f.Rules {
if r.Kind() == "workspace" {
return r.Name()
name = r.Name()
break
}
}
return ""
// HACK(bazelbuild/rules_go#2355, bazelbuild/rules_go#2387):
// We can't patch the WORKSPACE file with the correct name because Bazel
// writes it first; our patches won't apply.
if name == "com_google_googleapis" {
return "go_googleapis"
}
return name
}

func isDescendingDir(dir, root string) bool {
Expand Down