-
Notifications
You must be signed in to change notification settings - Fork 512
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new python comment annotation that adds targets to data
#1865
Comments
Note: one issue with this request is that Gazelle doesn't currently do anything with This also conflicts with how the Example of not removing manually added values:# some existing BUILD.bazel file, possibly generated by Gazelle before adding the annotation to the python file
py_library(
name = "foo",
srcs = ["foo.py"],
data = ["//manually/added/data:target"],
) # foo.py
# gazelle:include_data //foo:bar Running GazelleWantpy_library(
name = "foo",
srcs = ["foo.py"],
data = [
"//foo:bar",
"//manually/added/data:target",
],
) Don't wantpy_library(
name = "foo",
srcs = ["foo.py"],
data = ["//foo:bar"],
) |
I think the comment in python code controlling data is super neat. I would gate this feature under some boolean gazelle directive so that we can enable it everywhere at some point. In the next release it would be disabled and then once we know that it is working well, we enable it by default forcing users to either explicitly disable it or to update their code, then at some point we could remove the feature flag. What do you think? |
Agreed, being gated by a feature flag is definitely the way to go.
Can you elaborate on this? Are you saying that users must use |
Thinking about this more, I do think that the data management through comments in code has to stay opt-in. We could make it opt out instead where you would have to add the I am fine with just adding the opt-in feature flag and deciding on whether we want opt-out behaviour sometime in the future. |
馃殌 feature request
Relevant Rules
Description
This is the same as #1862, but for the
data
attribute on generated targets.Describe the solution you'd like
Running Gazelle generates:
Note that Gazelle does not generate the
test_data
target - it's still on the user to do that themselves.Describe alternatives you've considered
The current method is to manually add
data
attributes.The text was updated successfully, but these errors were encountered: