-
-
Notifications
You must be signed in to change notification settings - Fork 645
Closed
Description
Hi,
I have a library which I want to make public since it's a base library for many other parts of the codebase. Therefore I set the visibility to public for the whole file:
load("@aspect_rules_py//py:defs.bzl", "py_library")
package(default_visibility = ["//visibility:public"])
py_library(
name = "test",
srcs = ["test.py"],
)
Running gazelle however incorrectly adds a more restrictive visibility annotation, transforming the BUILD file to:
load("@aspect_rules_py//py:defs.bzl", "py_library")
package(default_visibility = ["//visibility:public"])
py_library(
name = "cli",
srcs = ["cli.py"],
visibility = ["//:__subpackages__"], # <---- This should not be added, right?
)
The added visibility is incorrect, as it overwrite the default visibility set at the package level.
Is there a way to fix this behavior, or at least provide a gazelle directive (at the root level) to tell gazelle to not add a visibility field to python targets?
Metadata
Metadata
Assignees
Labels
No labels