nice-park-1669303/16/2023, 8:57 AM
as an example -- I would like to be able to run
with the same config and versions through pre-commit as I do when I execute
so that the results are consistent, but I don't want to config these in two places. So far I've tried: • just run
via pre-commit, ignoring pants. This is fairly trivial but it needs me to write a version number in
as well as in
, and that's slightly annoying because those can get out of sync • change pre-commit to run
instead of using the
plugin directly. This avoids the need to duplicate config, but it has the downside that now pre-commit doesn't format build files or things that pants doesn't "know about", like stuff under
. Any pointers from someone who has trodden this path before? Same question applies to lint and check.
ripe-scooter-1066503/16/2023, 9:09 AM
broad-processor-9240003/16/2023, 10:36 AM
. I imagine this could be invoked from a pre commit hook. I think it’s possible to have BUILD files defining targets in
pants tailor update-build-files fmt lint check ::
too. Another option for them might be having the normal pre commit plug-in run on only the non-pants directories (and, even if the configs are different, at least each file has a single source of truth, either pants or pre-commit$.