proud-dentist-22844
05/21/2025, 6:21 PM@rule
funcs that are in the body of a rule builder method) in the adhoc backend the the migrate-call-by-name
script couldn't migrate.
Which of these styles is preferable:
Option 1: Expand the rules
cqt = await find_code_quality_tool(CodeQualityToolAddressString(address=self.target))
code_quality_tool_runner_request = await runner_request_for_code_quality_tool(cqt)
code_quality_tool_runner = await create_tool_runner(code_quality_tool_runner_request)
Option 2: Use implicitly
code_quality_tool_runner = await create_tool_runner(
**implicitly(CodeQualityToolAddressString(address=self.target))
)
find_code_quality_tool
and runner_request_for_code_quality_tool
are rules in the same file. create_tool_runner
is imported.
This is what the same lines look like before migrating them:
code_quality_tool_runner = await Get(
ToolRunner, CodeQualityToolAddressString(address=self.target)
)
wide-midnight-78598
05/21/2025, 6:25 PMwide-midnight-78598
05/21/2025, 6:26 PMproud-dentist-22844
05/21/2025, 6:28 PM**implicitly(...)
if anyone cares.wide-midnight-78598
05/21/2025, 6:30 PMproud-dentist-22844
05/21/2025, 6:30 PMfast-nail-55400
05/21/2025, 7:00 PMproud-dentist-22844
05/21/2025, 7:00 PMfast-nail-55400
05/21/2025, 7:00 PM./pants test src/python/pants/backend/adhoc/code_quality_tool_integration_test.py
resulted in lots of rule graph errors.fast-nail-55400
05/21/2025, 7:02 PMproud-dentist-22844
05/21/2025, 7:07 PMexecute_process(**implicitly(CodeQualityToolBatch
instead of just using the process_files
rule that goes directly from CodeQualityToolBatch
to FallibleProcessResult
. At least, that's the only significant difference I see.wide-midnight-78598
05/21/2025, 7:19 PMproud-dentist-22844
05/21/2025, 7:20 PM