Hello all, I have a quick question with how to use...
# plugins
w
Hello all, I have a quick question with how to use your
adhoc_tool
to run
tach
on a code base. Suppossing I have a BUILD file
Copy code
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:
Copy code
* 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 advance
f
adhoc_tool
cannot be used with the
run
goal, only
expoet-codegen
as that is how
adhoc_tool
integrates internally to provide outputs.
That said, look at
run_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 way
w
Thanks very much for this