https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

12/14/2021, 7:03 PM
Is there a way to make
update-build-files
run only on BUILD files which have changed? In pre-commit and CI I would like to avoid checking every file if we can.
💯 1
h

hundreds-father-404

12/14/2021, 7:10 PM
Getting it to work with
--changed-since
is semi-blocked by this proposal https://docs.google.com/document/d/1WWQM-X6kHoSCKwItqf61NiKFWNSlpnTC5QNu3ul9RDk/edit#heading=h.1h4j0d5mazhu which is the change I most want to make in 2022
l

loud-laptop-17949

12/14/2021, 7:50 PM
thanks! I will follow that
e

eager-dress-66405

12/14/2021, 8:05 PM
Related question: is
update-build-files
the only way to get our build files formatted? Can/should
fmt
apply to build files? It seems like "update the syntax of all build files for the latest version of pants" is a deeper and broader task than "format recently update BUILD files"
w

witty-crayon-22786

12/14/2021, 8:20 PM
@eager-dress-66405: yea: see https://github.com/pantsbuild/pants/issues/13504 for some more discussion there.
e

eager-dress-66405

12/14/2021, 11:23 PM
I see. So in the same way
fmt
currently runs both types of formatters (black and pyupgrade), but the later might get split into a
fix
goal in a later version,
update-build-files
is the only currently available way to format
BUILD
files be it for indentation or new pants syntax? +1 for making the
fmt
be able to run lightweight formatting (e.g. black) on `BUILD`files.
h

hundreds-father-404

12/14/2021, 11:27 PM
Yeah,
update-build-files
is currently the only way to do it The first step I want to do is unify
tailor
and
update-build-files
. I realized it's not very valuable for them to be separate. My dream is that you can run
./pants --changed-since=HEAD update-pants-config
(fusion of both) and it will make sure all your Pants config is in tip-top shape. Any missing targets are added, deprecations are fixed, BUILD files are pretty
w

witty-crayon-22786

12/15/2021, 12:10 AM
hm. i’m still thinking that the formatting and fixing aspects should be split semantically, rather than by which files they operate on
and in that regard, you would have
fix
and
fmt
, with: •
fix
making semantic changes to BUILD files, pants config, python files, scala files, etc, etc •
fmt
making formatting changes to all of the above.
🙌 1
6 Views