hmetzner 428d9d15a4 Second try to add files after node red was installed 3 anni fa
..
README.md 9cec9e1a18 first commit 3 anni fa
__init__.py 9cec9e1a18 first commit 3 anni fa
archived.py 9cec9e1a18 first commit 3 anni fa
base.py 9cec9e1a18 first commit 3 anni fa
brands.py 9cec9e1a18 first commit 3 anni fa
description.py 9cec9e1a18 first commit 3 anni fa
hacsjson.py 9cec9e1a18 first commit 3 anni fa
images.py 428d9d15a4 Second try to add files after node red was installed 3 anni fa
information.py 9cec9e1a18 first commit 3 anni fa
integration_manifest.py 9cec9e1a18 first commit 3 anni fa
issues.py 9cec9e1a18 first commit 3 anni fa
manager.py 9cec9e1a18 first commit 3 anni fa
topics.py 9cec9e1a18 first commit 3 anni fa

README.md

Repository validation

This is where the validation rules that run against the various repository categories live.

Structure

  • There is one file pr. rule.
  • All rule needs tests to verify every possible outcome for the rule.
  • It's better with multiple files than a big rule.
  • All rules uses ActionValidationBase as the base class.
  • Only use validate or async_validate methods to define validation rules.
  • If a rule should fail, raise ValidationException with the failure message.

Example

from .base import (
    ActionValidationBase,
    ValidationBase,
    ValidationException,
)

class SuperAwesomeRepository(ActionValidationBase):
    category = "integration"

    async def async_validate(self):
        if self.repository != "super-awesome":
            raise ValidationException("The repository is not super-awesome")