pants icon indicating copy to clipboard operation
pants copied to clipboard

Begin adding goal to assist with the call-by-name `@rule` syntax migration.

Open stuhood opened this issue 6 months ago • 0 comments

As discussed in #20572, this change adds a built-in goal migrate-call-by-name which emits all Get calls which should be migrated to call-by-name syntax.

A followup change should use the resulting information (@rule function pointers and Get signatures) to execute rewrites of the relevant files.

Emits lines like:

<function infer_python_conftest_dependencies at 0x113633af0>
  Get(<class 'pants.engine.target.Targets'>, [<class 'pants.engine.addresses.Addresses'>]) -> <function resolve_targets at 0x112335d30>
  Get(<class 'pants.engine.internals.graph.Owners'>, [<class 'pants.engine.internals.graph.OwnersRequest'>]) -> <function find_owners at 0x112349160>
  Get(<class 'pants.backend.python.util_rules.ancestor_files.AncestorFiles'>, [<class 'pants.backend.python.util_rules.ancestor_files.AncestorFilesRequest'>]) -> <function find_ancestor_files at 0x1131e6790>

stuhood avatar Feb 18 '24 21:02 stuhood