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

Directive to declare repository rules defined in macros #132

Closed
jayconrod opened this issue Feb 15, 2018 · 2 comments
Closed

Directive to declare repository rules defined in macros #132

jayconrod opened this issue Feb 15, 2018 · 2 comments

Comments

@jayconrod
Copy link
Contributor

Gazelle should understand directives in WORKSPACE that describe repositories declared using a mechanism other than go_repository (for example, a local_repository or an http_archive or something declared inside a macro). The directive should tell Gazelle the name of the repository and it's prefix.

# gazelle:repository <repo_name> <prefix>

Example:

# gazelle:repository com_github_pkg_errors github.com/pkg/errors
@jayconrod
Copy link
Contributor Author

This directive should be written so that it affects import resolution for a specific language.

# gazelle:repository go com_github_pkg_errors github.com/pkg/errors

@jayconrod
Copy link
Contributor Author

After #647, there is now a Repos field in config.Config which lists repositories read from the configuration file. # gazelle:repository should add fake rules to that list. That means the syntax should be rich enough to specify a rule kind and attributes. So something like this?

# gazelle:repository go_repository name=com_github_pkg_errors importpath=github.com/pkg/errors

It should be possible to override an actual repository with this rule. For example, if someone has a git_repository rule for org_golang_x_tools, they should be able to write:

# gazelle:repository go_repository name=org_golang_x_tools importpath=golang.org/x/tools

And Gazelle would proceed as if that rule were declared as a go_repository rule.

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

No branches or pull requests

1 participant