usda-hass-config/custom_components/hacs/validate
root f4ceef3cfe updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
..
README.md working 2.0 clone 2024-10-01 14:06:39 +00:00
__init__.py working 2.0 clone 2024-10-01 14:06:39 +00:00
archived.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
base.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
brands.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
description.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
hacsjson.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
images.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
information.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
integration_manifest.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
issues.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
manager.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00
topics.py updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT 2025-04-30 15:04:35 -04:00

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")