Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

Delete the rules_go load rule if it's not needed #38

Merged
merged 1 commit into from
Apr 24, 2017

Conversation

ixdy
Copy link
Collaborator

@ixdy ixdy commented Apr 20, 2017

If you try generating vendor/BUILD from scratch with VendorMultipleBuildFiles enabled, we add a useless load line:

load("@io_bazel_rules_go//go:def.bzl")

Simplest fix is to automatically remove this line in reconciliation when we don't need it.

x-ref kubernetes/kubernetes#41287 (comment).

@spxtr
Copy link
Collaborator

spxtr commented Apr 24, 2017

gazel is certainly not the most beautiful code to work with here...

How confident are you that this works as you expect?

@ixdy
Copy link
Collaborator Author

ixdy commented Apr 24, 2017

I've manually tested this and verified that it works.

If I run gazel on kubernetes/test-infra or kubernetes/kubernetes, no files change.

If I remove vendor/BUILD from either, it regenerates it correctly (without the useless load line in multi-vendor).

If I add a rules_go load line to a BUILD file with no go rules (e.g. jenkins/BUILD), it removes it as expected.

@spxtr
Copy link
Collaborator

spxtr commented Apr 24, 2017

That's sufficient for me.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants