Skip to content

Conversation

@chrislovecnm
Copy link
Contributor

@chrislovecnm chrislovecnm commented Jan 9, 2023

In order to use gazelle, you initially need an empty deps.bzl file. I added instructions on how to set up the file.

In order to use gazelle you intially need an empty deps.bzl file.
I added instrustions on how to set up the file.
@chrislovecnm
Copy link
Contributor Author

@alexeagle ping

@MattyKuzyk
Copy link

Looks fine, though I'm not sure why it's necessary over the simplicity of letting Gazelle generate deps.bzl for you (which it will do when bazel run //:gazelle-update-repos is run)

@chrislovecnm
Copy link
Contributor Author

@MattyKuzyk is there a different order from what the tutorial says? I have had this problem in a couple of different projects.

Once you run gazelle for the first time, if you have any external Go dependencies, gazelle will update the
`deps.bzl` file to include definitions of the external dependencies. The `deps.bzl` is not required but allows
gazelle to store the projects external Go dependencies in a seperate file. Otherwise all of the external Go dependencies
are defined in the `WORKSPACE` file, and if you have a large project, you can have hundreds of extra
Copy link
Contributor

Choose a reason for hiding this comment

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

sentence is dangling

pass
```

The above Starlark code defines the function that is reference in the `WORKSPACE` file. Below is a snippet
Copy link
Contributor

Choose a reason for hiding this comment

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

is reference -> is referenced


## Create the intial `deps.bzl` file

In order for gazelle to run properly the first time, you may need to create a `deps.bzl` file in the root directory of
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not "to run properly" right? If you go with the default behavior then the deps go in WORKSPACE like you say later. So it's more about "if you want to keep your WORKSPACE shorter"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants