Expand ref config CLI management commands#768
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds ChangesConfig CLI Expansion
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
packages/climate-ref/tests/unit/cli/test_config.py (1)
287-292: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTighten the invalid-literal assertion.
pytest.raises(Exception)is too broad here and can hide unrelated failures incoerce_value(). Please verify the concrete exception type for bad literals and assert that instead.docs/configuration.md (1)
64-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument
ref config edithere as well.This section covers the other config subcommands, but it skips
edit, which is part of the new management surface. A short note would make the feature easier to discover.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3822eeec-c5af-4518-9db2-6da6d6418c7c
📒 Files selected for processing (8)
changelog/768.feature.mddocs/configuration.mddocs/getting-started/01-configure.mdpackages/climate-ref/src/climate_ref/cli/__init__.pypackages/climate-ref/src/climate_ref/cli/_config_access.pypackages/climate-ref/src/climate_ref/cli/config.pypackages/climate-ref/src/climate_ref/config.pypackages/climate-ref/tests/unit/cli/test_config.py
Description
Adds a fuller
ref configmanagement surface for onboarding and day-to-day configuration edits:ref config initcreates a supportedref.tomltemplate, with overwrite protection and--no-defaultssupport.ref config get,set, andunsetsupport dotted scalar keys and environment override warnings.ref config validatevalidates the config file with text or JSON output and works even when the file is missing or malformed.ref config editopens the active config file and reports post-edit validation issues.ref config init/validate.Validation performed:
uv run pytest packages/climate-ref/tests/unit/cli/test_config.py -quv run pytest packages/climate-ref/tests/unit/cli -quv run pytest packages/climate-ref/tests/unit/test_config.py -quv run ruff checkuv run ruff format --checkmake mypyinit,validate,set,get, and invalid-file validation.Note:
uv run mkdocs buildcurrently fails on an existing notebook execution error indocs/how-to-guides/running-diagnostics-locally.py, unrelated to these changes.Checklist
Please confirm that this pull request has done the following:
changelog/Summary by CodeRabbit
ref configCLI commands to initialise, view (get), change (set), reset (unset), edit (edit), and validate configuration (validate).validateoutput options, including JSON suitable for scripting.