Skip to content

Commit 33d2390

Browse files
committed
Remove default config file and update config loader to use Pydantic models
1 parent f22180b commit 33d2390

2 files changed

Lines changed: 4 additions & 151 deletions

File tree

src/ciberwebscan/config/defaults.py

Lines changed: 0 additions & 148 deletions
This file was deleted.

src/ciberwebscan/config/loader.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from pydantic import ValidationError as PydanticValidationError
1616

17-
from .defaults import DEFAULTS
1817
from .models import (
1918
AppConfig as Config,
2019
)
@@ -94,7 +93,8 @@ def config(self) -> Config:
9493
def _load(self) -> None:
9594
"""Load configuration from all sources."""
9695
# Start with defaults
97-
self._raw = self._deep_copy(DEFAULTS)
96+
config = Config()
97+
self._raw = config.model_dump()
9898

9999
# Load from file if provided
100100
if self.config_path and self.config_path.exists():
@@ -225,10 +225,11 @@ def save(self, path: str | Path) -> None:
225225
# Create config dict excluding defaults that haven't changed
226226
config_to_save = {}
227227
current_config = self.config.model_dump()
228+
default_config = Config().model_dump()
228229

229230
# Only include non-default values
230231
for key, value in current_config.items():
231-
default_value = DEFAULTS.get(key)
232+
default_value = default_config.get(key)
232233
if value != default_value:
233234
config_to_save[key] = value
234235

0 commit comments

Comments
 (0)