diff --git a/src/cocoindex_code/settings.py b/src/cocoindex_code/settings.py index fb5b8be..0ae03db 100644 --- a/src/cocoindex_code/settings.py +++ b/src/cocoindex_code/settings.py @@ -110,7 +110,8 @@ def default_project_settings() -> ProjectSettings: # --------------------------------------------------------------------------- _SETTINGS_DIR_NAME = ".cocoindex_code" -_SETTINGS_FILE_NAME = "settings.yml" +_SETTINGS_FILE_NAME = "settings.yml" # project-level +_USER_SETTINGS_FILE_NAME = "global_settings.yml" # user-level def user_settings_dir() -> Path: @@ -127,8 +128,8 @@ def user_settings_dir() -> Path: def user_settings_path() -> Path: - """Return ``~/.cocoindex_code/settings.yml``.""" - return user_settings_dir() / _SETTINGS_FILE_NAME + """Return ``~/.cocoindex_code/global_settings.yml``.""" + return user_settings_dir() / _USER_SETTINGS_FILE_NAME def project_settings_path(project_root: Path) -> Path: diff --git a/tests/test_backward_compat.py b/tests/test_backward_compat.py index 09bb577..b8f5f35 100644 --- a/tests/test_backward_compat.py +++ b/tests/test_backward_compat.py @@ -31,7 +31,7 @@ def test_legacy_entry_creates_settings_from_env_vars( ) monkeypatch.setattr( "cocoindex_code.settings.user_settings_path", - lambda: tmp_path / "user" / "settings.yml", + lambda: tmp_path / "user" / "global_settings.yml", ) # Simulate env vars @@ -56,7 +56,7 @@ def test_legacy_entry_respects_existing_settings( ) monkeypatch.setattr( "cocoindex_code.settings.user_settings_path", - lambda: tmp_path / "user" / "settings.yml", + lambda: tmp_path / "user" / "global_settings.yml", ) custom = UserSettings( diff --git a/tests/test_client.py b/tests/test_client.py index 0f27b88..c4eb587 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -43,7 +43,7 @@ def daemon_env(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> tuple[Path, s monkeypatch.setattr("cocoindex_code.settings.user_settings_dir", lambda: user_dir) monkeypatch.setattr( "cocoindex_code.settings.user_settings_path", - lambda: user_dir / "settings.yml", + lambda: user_dir / "global_settings.yml", ) save_user_settings(default_user_settings()) diff --git a/tests/test_settings.py b/tests/test_settings.py index fa038bd..9891ee5 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -33,7 +33,7 @@ def _patch_user_dir(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: ) monkeypatch.setattr( "cocoindex_code.settings.user_settings_path", - lambda: tmp_path / ".cocoindex_code" / "settings.yml", + lambda: tmp_path / ".cocoindex_code" / "global_settings.yml", )