"""Schema guard: every settings attribute referenced by application code must be declared in DEFAULT_CONFIG. This is the regression net for the ``opendal_scheme`` class of bug — a config key read via ``settings.X`` that DEFAULT_CONFIG never declared, which crashes with AttributeError only when an admin actually selects that code path. """ import re import unittest from pathlib import Path from core.settings import DEFAULT_CONFIG REPO_ROOT = Path(__file__).resolve().parent.parent SCAN_DIRS = ["main.py", "core", "apps"] # Attribute references that are Settings' own machinery, not config keys. NON_CONFIG_ATTRS = {"items", "user_config", "default_config", "unknown_keys"} # Filename-extension tokens: matches like "core/settings.py" in docstrings. FILE_EXT_LIKE = {"py", "pyc", "toml", "ini", "cfg", "yaml", "yml", "md"} # (?