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

[buildifier]: add lint warning for disallowed load #1231

Open
alexeagle opened this issue Jan 16, 2024 · 0 comments
Open

[buildifier]: add lint warning for disallowed load #1231

alexeagle opened this issue Jan 16, 2024 · 0 comments

Comments

@alexeagle
Copy link
Contributor

Many ruleset users wrap the upstream rules with a macro that sets defaults, enforces policies, or creates an additional rule.

Gazelle can generate rules with a load statement that ensures the macro is used rather than directly loading the external rule, using the map_kind directive.

However, these users still need a way to prevent their developers accidentally loading symbols from a starlark module they forbid.

For example I'd want to configure buildifier to detect

load("@rules_python//python:defs.bzl", "py_library")

and print the suggestion of using a macro instead like

load("//tools/bazel/python:defs.bzl", "py_library")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant