cold-soccer-63228
06/21/2022, 2:27 PMupdate-build-files
on a subset of files? I want to run it in a pre-commit hook as a formatter, but having it run over the entirety of the repository causes commits to be extremely slow.
From https://www.pantsbuild.org/docs/reference-update-build-files, I see:
This goal is run without arguments. It will run over all BUILD files in your project.
bitter-ability-32190
06/21/2022, 3:10 PMbitter-ability-32190
06/21/2022, 3:11 PM--pants-ignore="+['...', '...']"
to tell pants to "ignore" certain dirs. during the command. YMMV on if that workscold-soccer-63228
06/21/2022, 3:11 PM./pants --changed-since=origin/master update-build-files
bitter-ability-32190
06/21/2022, 3:12 PMBUILD
files that werent changed in this branch 🤷♂️bitter-ability-32190
06/21/2022, 3:13 PMwide-midnight-78598
06/21/2022, 4:18 PMcold-soccer-63228
06/22/2022, 2:37 AMhundreds-father-404
06/23/2022, 5:02 PM./pants --changed-since=HEAD update-build-files
does what you would expect, and then you use normal CLI args like ./pants update-build-files ::
or ./pants update-build-files dir1
hundreds-father-404
06/23/2022, 5:03 PMcold-soccer-63228
06/23/2022, 5:17 PM