fix(config): remove obsolete cwd warning parameter
This commit is contained in:
@@ -2223,7 +2223,7 @@ def print_config_warnings(config: Optional[Dict[str, Any]] = None) -> None:
|
|||||||
sys.stderr.write("\n".join(lines) + "\n\n")
|
sys.stderr.write("\n".join(lines) + "\n\n")
|
||||||
|
|
||||||
|
|
||||||
def warn_deprecated_cwd_env_vars(config: Optional[Dict[str, Any]] = None) -> None:
|
def warn_deprecated_cwd_env_vars() -> None:
|
||||||
"""Warn if MESSAGING_CWD or TERMINAL_CWD is set in .env instead of config.yaml.
|
"""Warn if MESSAGING_CWD or TERMINAL_CWD is set in .env instead of config.yaml.
|
||||||
|
|
||||||
These env vars are deprecated — the canonical setting is terminal.cwd
|
These env vars are deprecated — the canonical setting is terminal.cwd
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class TestDeprecatedCwdWarning:
|
|||||||
|
|
||||||
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
||||||
|
|
||||||
warn_deprecated_cwd_env_vars(config={})
|
warn_deprecated_cwd_env_vars()
|
||||||
|
|
||||||
assert capsys.readouterr().err == ""
|
assert capsys.readouterr().err == ""
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class TestDeprecatedCwdWarning:
|
|||||||
|
|
||||||
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
||||||
|
|
||||||
warn_deprecated_cwd_env_vars(config={})
|
warn_deprecated_cwd_env_vars()
|
||||||
|
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert "MESSAGING_CWD" in captured.err
|
assert "MESSAGING_CWD" in captured.err
|
||||||
@@ -49,11 +49,16 @@ class TestDeprecatedCwdWarning:
|
|||||||
def test_dotenv_terminal_cwd_warns_with_explicit_config(
|
def test_dotenv_terminal_cwd_warns_with_explicit_config(
|
||||||
self, monkeypatch, tmp_path, capsys
|
self, monkeypatch, tmp_path, capsys
|
||||||
):
|
):
|
||||||
_write_env(monkeypatch, tmp_path, "TERMINAL_CWD=/legacy/path\n")
|
hermes_home = _write_env(
|
||||||
|
monkeypatch, tmp_path, "TERMINAL_CWD=/legacy/path\n"
|
||||||
|
)
|
||||||
|
(hermes_home / "config.yaml").write_text(
|
||||||
|
"terminal:\n cwd: /current/path\n", encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
||||||
|
|
||||||
warn_deprecated_cwd_env_vars(config={"terminal": {"cwd": "/current/path"}})
|
warn_deprecated_cwd_env_vars()
|
||||||
|
|
||||||
assert "TERMINAL_CWD=/legacy/path" in capsys.readouterr().err
|
assert "TERMINAL_CWD=/legacy/path" in capsys.readouterr().err
|
||||||
|
|
||||||
@@ -69,7 +74,7 @@ class TestDeprecatedCwdWarning:
|
|||||||
|
|
||||||
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
from hermes_cli.config import warn_deprecated_cwd_env_vars
|
||||||
|
|
||||||
warn_deprecated_cwd_env_vars(config={})
|
warn_deprecated_cwd_env_vars()
|
||||||
|
|
||||||
assert capsys.readouterr().err == ""
|
assert capsys.readouterr().err == ""
|
||||||
|
|
||||||
@@ -81,6 +86,6 @@ class TestDeprecatedCwdWarning:
|
|||||||
|
|
||||||
monkeypatch.setattr(config_module, "load_env", raise_read_error)
|
monkeypatch.setattr(config_module, "load_env", raise_read_error)
|
||||||
|
|
||||||
config_module.warn_deprecated_cwd_env_vars(config={})
|
config_module.warn_deprecated_cwd_env_vars()
|
||||||
|
|
||||||
assert capsys.readouterr().err == ""
|
assert capsys.readouterr().err == ""
|
||||||
|
|||||||
Reference in New Issue
Block a user