It is considered a good practice to not set default_visibility to public.
That is documented in https://bazel.build/versions/9.1.0/concepts/visibility
Best practice: Avoid setting default_visibility to public. It may be convenient for prototyping or in small codebases, but the risk of inadvertently creating public targets increases as the codebase grows. It's better to be explicit about which targets are part of a package's public interface.
It would be great if buildifier would provide a checker for it.
It is considered a good practice to not set
default_visibilityto public.That is documented in https://bazel.build/versions/9.1.0/concepts/visibility
It would be great if buildifier would provide a checker for it.