Skip to content

[buildifier] Add checker to detect default_visiblity set to public #1468

Description

@limdor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions