fresh-mechanic-68429
06/13/2024, 9:00 PMFixTargetsRequest that operates on a target instead of per-file?
I was able to make LintTargetsRequest work per target fairly easily, but Fix is setting by_file=True for some reason. I need all the source files in the target for my particular lint/fix rule
https://github.com/pantsbuild/pants/blob/e44697e5dc57e80c91ba7396f46fe044ea40ba40/src/python/pants/core/goals/fix.py#L173curved-television-6568
06/14/2024, 7:57 AMbitter-ability-32190
06/14/2024, 11:16 AMcurved-television-6568
06/14/2024, 1:01 PMfresh-mechanic-68429
06/14/2024, 11:45 PMclass MyFixRequest(FixTargetsRequest):
field_set_type = MyLintFieldSet
tool_subsystem = MySubsystem
partitioner_type = PartitionerType.CUSTOM
@rule
async def fix_partition_inputs(
request: MyFixRequest.PartitionRequest,
subsystem: MySubsystem,
) -> Partitions[str, PartitionMetadata]:
if subsystem.skip:
return Partitions()
all_sources_paths = await MultiGet(
Get(SourcesPaths, SourcesPathsRequest(getattr(field_set, "sources")))
for field_set in request.field_sets
)
# zip up the field sets with the sources paths. field set is the metadata
partitions = Partitions(
Partition(sources_paths.files, field_set)
for field_set, sources_paths in zip(request.field_sets, all_sources_paths)
)
return partitionsfresh-mechanic-68429
02/08/2025, 8:58 PMbatch_size files, which isn't ideal.
Opened an issue for it here https://github.com/pantsbuild/pants/issues/21935