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

Import Gazel, BUILD file generator #51

Closed
wants to merge 7 commits into from
Closed

Import Gazel, BUILD file generator #51

wants to merge 7 commits into from

Conversation

yugui
Copy link
Member

@yugui yugui commented Jul 20, 2016

Supported:

  • load golang build rules
  • Generate go_prefix if necessary
  • Generate go_library, go_binary, go_test rules
  • Refer dependencies between rules within a repository
  • Write BUILD files, show diff or just prints the result into stdout

To be supported later:

Gazel should be considered experimental. It is possible that this is replaced with glaze when Google opensources it.

c.f. #15

@yugui
Copy link
Member Author

yugui commented Jul 20, 2016

err = merr
}
}()
err = func() (err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, worrying about the error from the defer is overkill, and creates complexity without much gain.
I would have written (instead of line 31-49):
defer os.Remove(f.Name())
defer f.Close()
if _, err := f.Write(bzl.Format(file)); err != nil {
return err
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #60

@pmbethe09
Copy link
Member

This is a long review so it will take some time. FYI all TODO should have
a ':' after the paren and before the text.
e.g.

// TODO(yugui): Respect exisiting manual configurations as well as possible

On Tue, Jul 19, 2016 at 11:44 PM, Yuki Yugui Sonoda <
notifications@github.com> wrote:

http://ci.bazel.io/job/PR-rules_go/41/BAZEL_VERSION=latest,PLATFORM_NAME=darwin-x86_64/console

Looks to be a disk quota issue in Jenkins?


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#51 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALF-0gtneY-9EFZJqjPNL7cIDAXHBBXrks5qXZmDgaJpZM4JQZG7
.

"example.com/another/sub",
"example.com/repo_suffix",
} {
l, err := r.resolve(importpath, "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combine with if stmt

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #58

@davidzchen
Copy link
Member

davidzchen commented Jul 21, 2016

Thanks for creating this tool!

+cc @damienmg @kchodorow @laurentlb

I have one particular request: can we name this tool something other than "gazel?" I think the name is a bit confusing and have outlined a few reasons here. IIRC, we had some discussions internally as well where we also felt that naming the tool "gazel" or "glazel" would lose much of the meaning and pun around the original name, "glaze."

@pmbethe09
Copy link
Member

Would you consider splitting the PR into 2-3 smaller ones, making it easier on me to review?

@yugui
Copy link
Member Author

yugui commented Aug 3, 2016

@pmbethe09
Sure. I'll close this PR and create other smaller ones.

@davidzchen
I don't stick with a specific name, but I also don't have a good idea about other names. So I need your help to name it.
Did you have any recommendation in the discussion? gaze?

FYI, when I named it "gazel" I thought about the following things:

  • Something different from "glaze" so that it is not confusing with Google's internal one.
  • Something reminds "bazel"
  • Something starts with "g" for "generate"
  • Something pronounceable

@damienmg
Copy link
Contributor

damienmg commented Aug 3, 2016

Side note for the name gazel: https://en.wikipedia.org/wiki/Gazelle

On Wed, Aug 3, 2016 at 1:50 PM Yuki Yugui Sonoda notifications@github.com
wrote:

@pmbethe09 https://github.com/pmbethe09
Sure. I'll close this PR and create other smaller ones.

@davidzchen https://github.com/davidzchen
I don't stick with a specific name, but I also don't have a good idea
about other names. So I need your help to name it.
Did you have any recommendation in the discussion? gaze?

FYI, when I named it "gazel" I thought about the following things:

  • Something different from "glaze" so that it is not confusing with
    Google's internal one.
  • Something reminds "bazel"
  • Something starts with "g" for "generate"
  • Something pronounceable


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#51 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADjHfyTX5h__TVzJuuGKMPHSa4gZHdlzks5qcHujgaJpZM4JQZG7
.

@davidzchen
Copy link
Member

@yugui, thanks for the explanation, and @damienmg, that is a great suggestion!

How about if we name the tool Gazelle? The main thing that makes me hesitant about "Gazel" is that it doesn't really resemble (or sound like) a real word in any language that I am aware of. On the other hand, Gazelle would not only fulfill the criteria that @yugui listed above but it is also a real word and adds the impression that it is fast. :)

Another point that I just realized: while gazel is, in fact, the archaic form of gazelle, I think that if we want to go this route, it would be better to go with the name "gazelle" since the old form, "gazel," would likely introduce more confusion about how "gazel" and "bazel" are pronounced (since "bazel" is meant to be pronounced like "basil").

@yugui
Copy link
Member Author

yugui commented Aug 8, 2016

@davidzchen Sounds good. Let's go with "Gazelle".

@hanwen
Copy link
Contributor

hanwen commented Aug 17, 2016

thanks for doing this, and Gazelle is a lovely name :)

@yugui yugui deleted the feature/gazel branch August 22, 2016 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants