late-advantage-75311
08/17/2023, 7:06 PMall_batch_results = await MultiGet(
Get(LintResult, AbstractLintRequest.Batch, request) for request in batches
)
in the lint goal_rule ultimately ends up deferring to the rule that presumably calculates lintresults for shellcheck:
@rule(desc="Lint with Shellcheck", level=LogLevel.DEBUG)
async def run_shellcheck(
request: ShellcheckRequest.Batch[ShellcheckFieldSet, Any],
shellcheck: Shellcheck,
platform: Platform,
) -> LintResult:
• Does the above Get not end up calling this rule?
• is there some mechanism available because ShellcheckRequest.Batch is part of a union under AbstractLintRequest.Batch? If so where do we get the Platform needed for the rule given that it is not in the original Get?bitter-ability-32190
08/17/2023, 7:13 PMlate-advantage-75311
08/17/2023, 7:18 PMrequest object and notices that it is a ShellcheckRequest.Batch and looks for a route to LintResult from there?late-advantage-75311
08/17/2023, 7:19 PMbitter-ability-32190
08/17/2023, 7:20 PMlate-advantage-75311
08/17/2023, 7:35 PMgorgeous-winter-99296
08/17/2023, 8:12 PMlate-advantage-75311
08/17/2023, 11:12 PM@union does give an indication, though:
Annotating a class with @union allows other classes to register a. Then, you can useUnionRule(BaseClass, MemberClass). This would be similar to writingawait Get(Output, UnionBase, concrete_union_member), but allows you to write generic code without knowing what concrete classes might later implement that union.UnionRule(Output, ConcreteUnionMember, concrete_union_member_instance)