|
3 | 3 | import json |
4 | 4 | import os |
5 | 5 | from pathlib import Path |
6 | | -from typing import Dict, List, Any, Optional, Set |
| 6 | +from typing import Any, Optional |
7 | 7 |
|
8 | 8 | from rich.console import Console |
9 | 9 | from rich.text import Text |
@@ -47,7 +47,7 @@ class Validator: |
47 | 47 | def __init__(self, schema_path: Path, values_base_path: Optional[Path] = None): |
48 | 48 | self.schema_path = schema_path |
49 | 49 | self.values_base_path = values_base_path or Path(".") |
50 | | - self.errors: List[ValidationError] = [] |
| 50 | + self.errors: list[ValidationError] = [] |
51 | 51 |
|
52 | 52 | def validate_all(self, env: Optional[str] = None) -> bool: |
53 | 53 | """Validate schema and optionally values for specific environment.""" |
@@ -88,8 +88,8 @@ def _validate_schema(self): |
88 | 88 | self.errors.append(ValidationError("Schema", f"Unsupported version: {schema.version}")) |
89 | 89 |
|
90 | 90 | # Validate each entry |
91 | | - seen_keys: Set[str] = set() |
92 | | - seen_paths: Set[str] = set() |
| 91 | + seen_keys: set[str] = set() |
| 92 | + seen_paths: set[str] = set() |
93 | 93 |
|
94 | 94 | for entry in schema.values: |
95 | 95 | # Check for duplicate keys |
@@ -248,7 +248,7 @@ def print_errors(self): |
248 | 248 | console.print(f" - {str(error)}") |
249 | 249 |
|
250 | 250 |
|
251 | | -def validate_single_environment(schema: Schema, values: Dict[str, Any], env: str) -> List[str]: |
| 251 | +def validate_single_environment(schema: Schema, values: dict[str, Any], env: str) -> list[str]: |
252 | 252 | """Validate schema and values for a single environment and return list of errors. |
253 | 253 |
|
254 | 254 | Args: |
@@ -303,7 +303,7 @@ def validate_single_environment(schema: Schema, values: Dict[str, Any], env: str |
303 | 303 | return errors |
304 | 304 |
|
305 | 305 |
|
306 | | -def _validate_schema_integrity(schema: Schema) -> List[str]: |
| 306 | +def _validate_schema_integrity(schema: Schema) -> list[str]: |
307 | 307 | """Validate schema for duplicate keys and paths.""" |
308 | 308 | errors = [] |
309 | 309 |
|
|
0 commit comments