usda-hass-config/custom_components/hacs/validate
Hunter bffaec3a88 USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
..
README.md USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
__init__.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
archived.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
base.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
brands.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
description.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
hacsjson.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
images.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
information.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
integration_manifest.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
issues.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
manager.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -04:00
topics.py USDA Pecan IOT Facility first public backup 2024-09-25 10:01:13 -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")