Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/cocoindex_code/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_backward_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
2 changes: 1 addition & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)


Expand Down
Loading