flat-zoo-31952
03/21/2022, 5:21 PMwitty-crayon-22786
03/21/2022, 5:23 PMwitty-crayon-22786
03/21/2022, 5:24 PMEngineAwareReturnType
interface for the return value of a `@rule`: in particular, the message
and level
methods: https://github.com/pantsbuild/pants/blob/1aaa97b28f46aee504badf96ea3fc6481ec9986b/src/python/pants/engine/engine_aware.py#L39-L64flat-zoo-31952
03/21/2022, 5:32 PM@dataclass(frozen=True)
class ShowProcessResult(EngineAwareReturnType):
result: ProcessResult
def message(self):
return some_transformation_on(self.result.stdout, self.result.stderr)
@rule
def show_process_result(process: Process) -> ShowProcessResult:
result = await Get(ProcessResult, Process, process)
return ShowProcessResult(result)
flat-zoo-31952
03/21/2022, 5:35 PMsome_transformation_on()
is implied to be some function that makes the output of this process suitable for displaying back to the user