mirror of
https://github.com/Findus23/acronomy.git
synced 2024-09-19 15:33:45 +02:00
23 lines
452 B
Python
23 lines
452 B
Python
|
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()
|