Repository navigation
Avoid I2S include on Renesas boards - #3749
Conversation
📝 WalkthroughWalkthroughRenesas Arduino I2S detection now disables known-broken targets before probing ChangesRenesas I2S include guard
Estimated code review effort: 3 (Moderate) | ~15–30 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
🧹 Nitpick comments (1)
ci/tests/test_renesas_i2s_include_guard.py (1)
1-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove the Renesas include-guard test into the CI platform test suite.
This is a minor regression case but currently lives in a standalone new file. Add/remove the test according to the project’s platform/compiler test convention; per the Python guidelines, minor test additions should be consolidated into existing test files rather than creating new ones.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ci/tests/test_renesas_i2s_include_guard.py` around lines 1 - 53, Move test_renesas_guard_skips_poisonous_i2s_header into the existing CI platform/compiler test module that covers Arduino audio include guards, and remove the standalone test file. Preserve the test’s current compiler discovery, temporary header setup, preprocessing command, and ARDUINO_I2S_FULLY_SUPPORTED assertion.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@ci/tests/test_renesas_i2s_include_guard.py`:
- Around line 1-53: Move test_renesas_guard_skips_poisonous_i2s_header into the
existing CI platform/compiler test module that covers Arduino audio include
guards, and remove the standalone test file. Preserve the test’s current
compiler discovery, temporary header setup, preprocessing command, and
ARDUINO_I2S_FULLY_SUPPORTED assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 29354d19-1b1b-43fb-a908-cfe97abf7716
📒 Files selected for processing (2)
ci/tests/test_renesas_i2s_include_guard.pysrc/platforms/arduino/audio_input.hpp
Found while checking PR #3749's new test against the ratchet. Running subprocess_capture_checker.py ci/tests/some_file.py reported "239 baselined subprocess usage(s) are now gone" -- because the improvement check compared the whole baseline against a single file's findings. Every entry for a file that was simply not examined counted as fixed. That message is wrong on its own, but the dangerous part is the action it invites: adding --update-baseline to that same narrow command rewrote the baseline from just that file, silently deleting the other 128 entries and turning the ratchet off across the repo. The next raw Popen would have gone in unnoticed. Both halves now key off the set of files actually scanned: - --update-baseline merges instead of overwriting, keeping entries for unscanned files verbatim. A file that genuinely improved still shrinks or drops out, so the ratchet can still be tightened incrementally. - The "now gone" note only counts entries for files this run looked at. Also drops the two check_array_params/check_noexcept SRC004 entries that #3747 resolved -- the baseline was generated just before that merged, so it was stale by exactly those two. Tests cover the narrow-update case, the misleading note, that a rescanned file can still shrink, and that a genuinely new violation still fails. The first three fail against the previous implementation. Validated: 556 passed / 39 skipped in ci/tests, lint green. Co-Authored-By: Claude <[email protected]>
Summary
I2S.hI2S.hOn ArduinoCore-renesas,
I2S.hcan be discoverable even though including it fails because the bundled FSP does not provider_i2s_api.h. The existing guard ran only after that include.Caveat: PlatformIO's Library Dependency Finder may still scan the guarded literal
#include <I2S.h>without honoring preprocessor flow. Downstream UNO R4 PlatformIO projects therefore still needlib_ignore = I2S; FastLED CI already applies that exclusion.Related: arduino/ArduinoCore-renesas#521
Validation
uv run pytest ci/tests/test_renesas_i2s_include_guard.py -quv run ruff check ci/tests/test_renesas_i2s_include_guard.pyuv run ruff format --check ci/tests/test_renesas_i2s_include_guard.pybash compile uno_r4_wifi Blink --backend platformioThe default fbuild path was also attempted, but its current macOS ARM toolchain URL returns HTTP 404 before compilation starts.
Summary by CodeRabbit
Bug Fixes
Tests