From c68659d903c72d301a3babd6f5c1e341da0e7b3a Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Wed, 4 Feb 2026 05:57:48 +0000 Subject: [PATCH] fix: resolve CI linting and type checking errors --- scaffoldforge/config.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scaffoldforge/config.py b/scaffoldforge/config.py index f406eee..0473303 100644 --- a/scaffoldforge/config.py +++ b/scaffoldforge/config.py @@ -2,7 +2,7 @@ import os from pathlib import Path -from typing import Any, Dict, Optional +from typing import Any, Optional import yaml @@ -11,7 +11,7 @@ class Config: """Configuration management class.""" _instance: Optional["Config"] = None - _config: Dict[str, Any] = {} + _config: dict[str, Any] = {} def __new__(cls) -> "Config": if cls._instance is None: @@ -78,20 +78,22 @@ class Config: """Load configuration from YAML file.""" path = Path(config_path) if path.exists(): - with open(path, "r") as f: + with open(path) as f: user_config = yaml.safe_load(f) or {} self._config.update(user_config) - def get(self, key: str, default: Any = None) -> Any: + def get(self, key: str, default: Any | None = None) -> Any: """Get configuration value using dot notation.""" keys = key.split(".") - value = self._config + value: Any = self._config for k in keys: if isinstance(value, dict): value = value.get(k) else: return default - return value if value is not None else default + if value is None: + return default + return value def get_github_token(self) -> Optional[str]: """Get GitHub token from environment or config."""