pyapp
pyapp copied to clipboard
Extend Factory check_definition method to include a check_instance method
Currently, factories include checks to confirm settings are correct, this can be extended to doing instance checks, however, this requires boilerplate code that could be included in the core library.
eg:
def check_definition(self, Dict[str, Dict[str, Any]], name: str, **_):
messages = super().check_definition(check_definitions, name, **_)
if any(message.level >= ERROR for message in messages):
return messages
messages.extend(self.check_instance(check_definitions, name, **_))
return messages