Repository navigation
fix(hooks): use handle_keyboard_interrupt in protect_example_ino - #2550
Conversation
The KBI002 linter requires every `except KeyboardInterrupt` block to
either call `_thread.interrupt_main()` or `handle_keyboard_interrupt(ki)`
before re-raising. The previous bare `except KeyboardInterrupt: raise`
was added when the fail-fast handling for JSONDecodeError was introduced
and tripped the KBI002 check on `bash lint`.
Match the canonical pattern used in `ci/util/boot_wait.py`:
except KeyboardInterrupt as ki:
from ci.util.global_interrupt_handler import handle_keyboard_interrupt
handle_keyboard_interrupt(ki)
raise
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR updates the build hook's KeyboardInterrupt handling to use a shared project handler, replacing a bare exception block with a call to ChangesUnified Keyboard Interrupt Handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
`bash lint` was failing with `KBI002` on `ci/hooks/protect_example_ino.py:38`. Switch to the canonical pattern from `ci/util/boot_wait.py`:
```python
except KeyboardInterrupt as ki:
from ci.util.global_interrupt_handler import handle_keyboard_interrupt
handle_keyboard_interrupt(ki)
raise
```
No behaviour change.
Test plan
Summary by CodeRabbit