Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
fix(cli): stop warning that the mock provider is unknown (#4287)
Jay5622ca487329
diff --git a/packages/cli/src/repowise/cli/_helpers/providers.py b/packages/cli/src/repowise/cli/_helpers/providers.pyindex aa56a467a..8542af4ad 100644--- a/packages/cli/src/repowise/cli/_helpers/providers.py+++ b/packages/cli/src/repowise/cli/_helpers/providers.py@@ -264,9 +264,11 @@ def validate_provider_config(return warnings# Validate specific provider- if provider_name not in provider_env_vars:+ if provider_name not in PROVIDER_SPECS:warnings.append(f"Unknown provider '{provider_name}' - cannot validate configuration")return warnings+ if provider_name not in provider_env_vars:+ return warnings# Any one of a provider's env vars satisfies it (GEMINI_API_KEY or# GOOGLE_API_KEY), the same rule resolution applies.diff --git a/tests/unit/cli/test_helpers.py b/tests/unit/cli/test_helpers.pyindex ce0ecab03..67a44ce83 100644--- a/tests/unit/cli/test_helpers.py+++ b/tests/unit/cli/test_helpers.py@@ -590,6 +590,14 @@ class TestValidateProviderConfig:assert validate_provider_config() == []+ def test_mock_provider_needs_no_key_and_is_not_unknown(self):+ assert validate_provider_config("mock") == []++ def test_unregistered_provider_still_warns_unknown(self):+ warnings = validate_provider_config("nope")+ assert len(warnings) == 1+ assert "Unknown provider 'nope'" in warnings[0]+def test_gemini_with_gemini_key(self, monkeypatch):monkeypatch.setenv("GEMINI_API_KEY", "test-key")monkeypatch.setenv("REPOWISE_PROVIDER", "gemini")