Hi team, does anyone know of a library ( hopefully...
# general
c
Hi team, does anyone know of a library ( hopefully in python) that allows you to parse the Starlark BUILD file ? I am looking at some helper functionality to automatically edit/add some target definitions in existing BUILD files.
1
b
FWIW Pants' BUILD files are straight-up Python, not Starlark. That being said, look into Bazel's Buildozer. It'll be comptaible
👍 1
h
for adding target definitions, you might want to hook into the
tailor
goal also
if you're doing something more permanent, you can add a "fixer" to
update-build-files
to make whatever changes you want. It's a very flexible API -- takes in the BUILD file contents as a string and then you return back what you want
c
thanks for the suggestions! 🙂
❤️ 1
w
c
ah! awesome thanks for the link, that looks like what I am looking for
w
(thanks to @fresh-cat-90827!)
❤️ 1