backend: remove __main__ runner; typing: fix mypy across core and routes; tooling: use uv for pytest in pre-commit; security: narrow broad except in config; mypy: relax untyped decorator check for backend.app.main
This commit is contained in:
@@ -43,7 +43,7 @@ class UnitTemplate:
|
||||
class WebApplicationTemplate(UnitTemplate):
|
||||
"""Template for web application services."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
name="webapp",
|
||||
description="Web application service (Node.js, Python, etc.)",
|
||||
@@ -159,7 +159,7 @@ class WebApplicationTemplate(UnitTemplate):
|
||||
class DatabaseTemplate(UnitTemplate):
|
||||
"""Template for database services."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
name="database",
|
||||
description="Database service (PostgreSQL, MySQL, MongoDB, etc.)",
|
||||
@@ -249,7 +249,7 @@ class DatabaseTemplate(UnitTemplate):
|
||||
class BackupTimerTemplate(UnitTemplate):
|
||||
"""Template for backup timer services."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
name="backup-timer",
|
||||
description="Scheduled backup service with timer",
|
||||
@@ -334,7 +334,7 @@ class BackupTimerTemplate(UnitTemplate):
|
||||
class ProxySocketTemplate(UnitTemplate):
|
||||
"""Template for socket-activated proxy services."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
name="proxy-socket",
|
||||
description="Socket-activated proxy service",
|
||||
@@ -436,7 +436,7 @@ class ProxySocketTemplate(UnitTemplate):
|
||||
class ContainerTemplate(UnitTemplate):
|
||||
"""Template for containerized services (Docker/Podman)."""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
name="container",
|
||||
description="Containerized service (Docker/Podman)",
|
||||
@@ -596,11 +596,11 @@ class ContainerTemplate(UnitTemplate):
|
||||
class TemplateRegistry:
|
||||
"""Registry for managing available unit file templates."""
|
||||
|
||||
def __init__(self):
|
||||
self._templates = {}
|
||||
def __init__(self) -> None:
|
||||
self._templates: Dict[str, UnitTemplate] = {}
|
||||
self._register_default_templates()
|
||||
|
||||
def _register_default_templates(self):
|
||||
def _register_default_templates(self) -> None:
|
||||
"""Register all default templates."""
|
||||
templates = [
|
||||
WebApplicationTemplate(),
|
||||
@@ -613,7 +613,7 @@ class TemplateRegistry:
|
||||
for template in templates:
|
||||
self.register(template)
|
||||
|
||||
def register(self, template: UnitTemplate):
|
||||
def register(self, template: UnitTemplate) -> None:
|
||||
"""Register a new template."""
|
||||
self._templates[template.name] = template
|
||||
|
||||
@@ -636,7 +636,7 @@ class TemplateRegistry:
|
||||
def search(self, query: str) -> List[UnitTemplate]:
|
||||
"""Search templates by name, description, or tags."""
|
||||
query = query.lower()
|
||||
results = []
|
||||
results: List[UnitTemplate] = []
|
||||
|
||||
for template in self._templates.values():
|
||||
# Search in name and description
|
||||
|
||||
Reference in New Issue
Block a user