bitter-ability-32190
10/06/2022, 6:21 PMrule_runner
?QueryRule
fast-nail-55400
10/06/2022, 6:29 PMSubsystemRule
in the list of RuleRunner
rules should fix thatbitter-ability-32190
10/06/2022, 6:30 PMdef test_default_single_partition_partitioner() -> None:
class KitchenSubsystem(Subsystem):
options_scope = "kitchen"
help = "a cookbook might help"
name = "The Kitchen"
skip = SkipOption("lint")
class LintKitchenRequest(LintTargetsRequest):
field_set_type = MockLinterFieldSet
tool_subsystem = KitchenSubsystem
rules = list(
LintKitchenRequest._get_registration_rules(
partitioner_type=PartitionerType.DEFAULT_SINGLE_PARTITION
)
)
rule_runner = RuleRunner(rules=rules)
field_sets = (
MockLinterFieldSet(Address("knife"), MultipleSourcesField(["knife"], Address("knife"))),
MockLinterFieldSet(Address("bowl"), MultipleSourcesField(["bowl"], Address("bowl"))),
)
partitions = rule_runner.request(
Partitions,
[
LintKitchenRequest.PartitionRequest(field_sets),
],
)
TaskRule(_output_type=<class 'pants.core.goals.lint_test.test_default_single_partition_partitioner.<locals>.KitchenSubsystem'>, input_selectors=(), input_gets=(Get(ScopedOptions, Scope, ..),), func=functools.partial(<function _construct_subsytem at 0x7f55c29011f0>, <class 'pants.core.goals.lint_test.test_default_single_partition_partitioner.<locals>.KitchenSubsystem'>), cacheable=True, canonical_name='construct_scope_kitchen', desc=None, level=<LogLevel.TRACE: 'trace'>)
QueryRule(Partitions, [LintKitchenRequest.PartitionRequest]),
worksfast-nail-55400
10/06/2022, 6:50 PMrule_runner.request
has to have a matching QueryRule