witty-furniture-6665
09/09/2025, 10:30 AMadhoc_tool to run tach on a code base.
Suppossing I have a BUILD file
pex_binary(
name="tach",
entry_point="tach",
dependencies=[
"python-default#actually_shared", # resolves Tach from PyPI
],
)
adhoc_tool(
name="tach_check",
runnable=":tach",
args=[
"check", # Run `tach check`
".", # On the whole repo (or a subdir if you want)
],
log_output=True,
output_directories=[],
execution_dependencies=[
":src", # Source code
"tach.toml", # Config file
],
root_output_directory=".",
)
Point to that with check-tach = "run pants-plugins/cre/tach:tach_check" ,
When i run pants check-tach :: , i get a list of all sub dirs and a question as follows:
* src/tools/sales/ingest.py
* src/tools/sales/ingest_stages/__init__.py
* src/tools/sales/ingest_stages/r2s.py
* src/tools/sales/ingest_stages/s2m.py
* src/tools/sales/ingest_stages/s2m_test.py:tests
* src/tools/sales/load_data.py
* src/tools/sales/plants/__init__.py
* src/tools/sales/plants/adr.py
* src/tools/sales/plants/adr_test.py:tests
* src/tools/security/review.py
* src/tools/venv:create
Please select one of these targets to run.
I am trying to run tach check . , what am i doing wrong?
Any help would be greatly appreciated on this, thanks in advancefast-nail-55400
09/09/2025, 1:04 PMadhoc_tool cannot be used with the run goal, only expoet-codegen as that is how adhoc_tool integrates internally to provide outputs.fast-nail-55400
09/09/2025, 1:06 PMrun_shell_command and test_shell_command target types with your adhoc_tool as a runnable_dependenies or execution_dependencies (as apprpriate) and invoke it that waywitty-furniture-6665
09/09/2025, 2:25 PM