hey folks. <https://www.pantsbuild.org/v2.9/docs/r...
# development
f
hey folks. https://www.pantsbuild.org/v2.9/docs/reference-update-build-files
update-build-files
is great because
fmt
will format your
BUILD
files code. However, I wonder how difficult would it be to extend the goal to let user pick a formatter (currently only
black
is supported). The code of interest: https://github.com/pantsbuild/pants/blob/d3b1d24372a60aca0cbd3c54b73363ddfac4b883/src/python/pants/core/goals/update_build_files.py#L258-L257. It would be helpful to be able to choose a formatter for the
BUILD
files. Is it something trivial or would it require a deeper thought?
h
Definitely feasible! Great idea. Right now you enable/disable Black formatting via
--update-build-files-fmt
, and I think it probably makes sense to keep that. Maybe we add a new option
--update-build-files-formatter={black,yapf}
? Note that it doesn't make sense to add isort and autoflake because imports are banned. docformatter feels like overkill
f
--update-build-files-formatter={black,yapf}
yes, that’s exactly what I thought. I think keeping it to
black
and
yapf
will suffice
👍 1
how shall add this to the backlog — would you like a GitHub issue or something else? 🙂
h
yes please 🙂
would you be interested in contributing? I can add some instructions to the issue - should be mostly copy pasta
f
I’d love to contribute, yes! Hence my question on how difficult this is 🙂 I’ll author an issue and let’s work from there!
🙌 1