You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(gazelle) Delete python targets with invalid srcs (#3046)
When running Gazelle, it generated the following target:
```
py_binary(
name = "remove_py_binary",
srcs = ["__main__.py"],
main = "__main__.py",
visibility = ["//visibility:public"],
)
```
After `__main__.py` was deleted and the change committed, re-running
Gazelle did not remove the file from the srcs list.
This change introduces logic to check whether all entries in a Python
target’s srcs attribute correspond to valid files. If none of them
exist, the target is added to result.Empty to signal that it should be
cleaned up. This cleanup behavior applies to when python_generation mode
is package or file, as all `srcs` are expected to reside directly within
the current directory.
---------
Co-authored-by: yushan <yushan@uber.com>
Co-authored-by: Douglas Thor <dougthor42@users.noreply.github.com>
0 commit comments