My personal answer is that things inside pants sho...
# development
a
My personal answer is that things inside pants should never mutate input files, and if you want to modify things you should either: 1. From a wrapper script, run some kind of pants query to get the information you need to run commands, and then run those commands outside of pants, or 2. Ask pants to do the thing for you outputting to a temporary directory (like https://github.com/pantsbuild/pants/blob/97cddca085d3e436b9f0a67266f208a3ed238d65/src/python/pants/backend/jvm/tasks/rewrite_base.py#L27-L30 supports) and if you want to do the overwriting, do that in a wrapper script / similar