1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00
acronomy/acros/utils/checks/check_registry.py

23 lines
452 B
Python
Raw Normal View History

from typing import Set
from . import BaseCheck
class CheckRegistry:
def __init__(self):
self.checks: Set[BaseCheck] = set()
def register(self, check: BaseCheck):
self.checks.add(check)
def run_checks(self):
errors = []
for Check in self.checks:
inst = Check()
new_errors = list(inst.run())
errors.extend(new_errors)
return errors
registry = CheckRegistry()