fix: address pre-publish review issues#12
Conversation
- Remove duplicate/conflicting petfeeder pitfall lines (1-10 vs 1-60) - Skip MCP tests gracefully when optional mcp dependency is missing - Move DeviceController instantiation after device existence check
Greptile SummaryThis PR addresses three pre-publish review issues across the CLI command layer, skill generator, and MCP test suite — all changes are small, targeted, and non-breaking.
|
| Filename | Overview |
|---|---|
| src/iotcli/cli/commands/control.py | Moves DeviceController instantiation after the device-not-found guard — correct intent, but the guard still lacks an explicit return, leaving the flow implicitly dependent on out.error() always calling sys.exit(). |
| src/iotcli/skills/generator.py | Removes the conflicting duplicate petfeeder pitfall bullet (N = 1–60); the correct N = 1–10 bullet is retained. |
| tests/test_mcp.py | Adds pytest.importorskip("mcp") at module level — standard pytest idiom that correctly skips the entire module when the optional [mcp] extra is not installed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[control command invoked] --> B[resolve device via cfg.get_device_or_none]
B --> C{device found?}
C -- No --> D[out.error — sys.exit]
C -- Yes --> E[create DeviceController]
E --> F{action?}
F -- on --> G[ctrl.turn_on]
F -- off --> H[ctrl.turn_off]
F -- status --> I[ctrl.get_status]
F -- set --> J[ctrl.set_value]
G & H & I & J --> K[update config status / output result]
Reviews (1): Last reviewed commit: "fix(skills,cli,tests): address pre-publi..." | Re-trigger Greptile
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
Addresses three issues flagged in the pre-publish code review:
Remove duplicate petfeeder pitfall lines (
src/iotcli/skills/generator.py) — two conflicting lines (N=1–10 vs N=1–60) were present; kept the correct one.Skip MCP tests when optional dep is missing (
tests/test_mcp.py) — addedpytest.importorskip("mcp")so the test suite passes cleanly without the[mcp]extra installed.Move DeviceController after device check (
src/iotcli/cli/commands/control.py) — avoids unnecessary object creation when the device name is a typo.Test plan
pytest -qpasses (4 passed, 1 skipped)🤖 Generated with Claude Code