bazel-contrib / bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.19k stars 378 forks source link

feat(go_repository): add visibility restrictions to go_repository rules #1899

Open tyler-french opened 1 month ago

tyler-french commented 1 month ago

There are certain go_repository rules (or go_deps.gazelle_override)s that should have a limited visibility within our repo.

It would be very helpful to be able to apply a visibility to the rule, and have gazelle change the visibility for the internal BUILD files to restrict these packages from being used in other directories.

However, the packages would still need to be visible to other external rules.