tests/led での設定例の追加とTS strict対応#394
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughUpdated preference handling and configuration validation; changed one LED Blink timeline call to pass Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@firmware/stackchan/main.ts`:
- Around line 48-50: The asNumber function currently accepts NaN and Infinity
because typeof returns "number"; update asNumber to return the fallback whenever
the input is not a finite number (use Number.isFinite) so corrupted prefs can't
be passed into the Tone constructor (where Tone is created); specifically change
the guard in asNumber to check Number.isFinite(value) and only return value when
true, otherwise return fallback, ensuring callers that build Tone receive only
finite numeric values.
In `@firmware/tests/led/main.ts`:
- Around line 6-9: Fix the typo in the commented board presets: replace
"M5AStack" with "M5Stack" in the two comment lines that precede the ledConfig
presets (the lines containing the commented presets for ledConfig like "// const
ledConfig = { pin: 26, length: 18 }" and "// const ledConfig = { pin: 9, length:
18 }") so the board name matches the existing "M5Stack" comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a013b3ee-47ac-4734-8026-d1e405f63303
📒 Files selected for processing (4)
firmware/stackchan/led/led.tsfirmware/stackchan/main.tsfirmware/stackchan/utilities/loadPreference.tsfirmware/tests/led/main.ts
Summary by CodeRabbit
Bug Fixes
Tests