pyapp icon indicating copy to clipboard operation
pyapp copied to clipboard

Extend Factory check_definition method to include a check_instance method

Open timsavage opened this issue 3 years ago • 0 comments

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

timsavage avatar Feb 01 '21 05:02 timsavage