fix: smoke-test 3.6.0 bugs + quality gates#46
Merged
Conversation
added 3 commits
May 15, 2026 19:33
- parseStrictInt: reject leading zeros (032) and enforce consistent integer parsing across setBrightness, setColorTemperature, intRange - allowExcessArguments(false): extra positional args now error globally - devices status: accept variadic positional IDs (batch path reuse) - dry-run output: move human-readable messages to stderr (devices, expand, batch, plan) so --format pipelines stay clean - health --format: wire up resolveFormat/renderRows for all formats; handle --format id with a clean UsageError instead of a stack trace - health audit breakdown: classify statusCode-less errors as 'client' (expected) instead of 'unknown' (unexpected) - catalog search: reject empty keyword - doctor: add catalog-coverage check (warn on device types missing from the static catalog) - format matrix contract tests (15 cases)
…t errors unexpected - Remove .trim() from parseStrictInt so ' 50' and '50 ' are rejected (whitespace in the value is user error, not a CLI artifact) - Allow + prefix in regex so +50, +1, +100 are accepted as valid ints - Revert audit breakdown: only EXPECTED_ERROR_CODES (161/171/190) are expected; statusCode-less errors (timeouts, DNS) remain unexpected so health degrades correctly during real outages
- Add lint-stdout.sh and verify-release.mjs scripts - Convert bare Number() in entry-point validators to parseStrictInt() - Move dry-run output to stderr in install/uninstall/scenes/policy/rules - Fix corresponding test assertions (stdout → stderr)
Collaborator
Author
Code reviewFound 3 issues:
switchbot-openapi-cli/src/commands/rules.ts Lines 893 to 897 in fc16327
switchbot-openapi-cli/src/utils/health.ts Lines 112 to 114 in fc16327
switchbot-openapi-cli/src/commands/doctor.ts Lines 998 to 1000 in fc16327 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
added 3 commits
May 15, 2026 20:29
…s 3K, Remote, Presence Sensor)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parseStrictInt()as single source of truth for integer validation (rejects leading zeros, whitespace; accepts +N)scripts/lint-stdout.shquality gate (dry-run channel enforcement, bare Number() detection, command test coverage)scripts/verify-release.mjspre-release invariant checker (MCP tool count, audit version, doc consistency)tests/contract/format-matrix.test.ts(health + catalog × 5 formats)catalog-coveragedoctor checkTest plan
npm test— 2385 tests passbash scripts/lint-stdout.sh— all checks passnode scripts/verify-release.mjs— no errorsnpm run typecheck— clean🤖 Generated with Claude Code