Repository navigation
Compile Deployed Configs in CI and Lint ESPHome Warnings - #281
Conversation
- Add every top-level device config to the compile matrix beside the test/ example devices, and run the legs when one changes, so a deployed config's own lambdas are linted. - Report ESPHome's own WARNING lines from the compile output as findings on the config, such as a deprecated key, which no compiler sees. - Let known unfixable warnings through tools/compile-lint/allowed-warnings.yaml, each entry scoped to the configs it names and carrying its reason. - Document both in OPERATIONS.md "Compile Lint", plus deleting a build directory rather than running esphome clean, which wipes the shared pio_components and PlatformIO cache. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #281 +/- ##
===========================================
+ Coverage 84.61% 85.89% +1.28%
===========================================
Files 3 3
Lines 624 695 +71
===========================================
+ Hits 528 597 +69
- Misses 96 98 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The main factor is a moderate active finding: build_from_log returns the whole log, so warnings from an earlier compile can be attributed to the last config's line 1, and two additional nit findings also remain open.
3 open issues
What changed in this PR
This PR closes two gaps that let warnings reach the dashboard unreported. Deployed device configs were never compiled in CI, and ESPHome's own WARNING lines were not checked by the compile lint. Both are now covered, and known unfixable warnings are listed in an allow file with reasons.
Changes:
- CI compiles every
test/*.yamlexample device and every top-level device config. The change gate also runs when a top-level config changes, and each leg is named by its config path. - In
--compileand--from-logmode, the lint reads ESPHomeWARNINGlines and reports each one as a finding on line 1 of the config. Repeated warnings are reported once. - A new
allowed-warnings.yamllets through known warnings that cannot be fixed here. Each entry has a whole-message regex, the configs it applies to, and a reason.--verboselists what was allowed. OPERATIONS.mddocuments both behaviors and explains how to force a rebuild by deleting the build directory instead of runningesphome clean.
| File | Description |
|---|---|
| tools/compile-lint/src/compile_lint/lint.py | Reads ESPHome warnings from compile output, matches them against the allow list, and reports the rest as findings on line 1. |
| tools/compile-lint/allowed-warnings.yaml | New allow list for three known warnings, each with the configs it applies to and a reason. |
| tests/compile_lint/test_lint.py | Adds tests for warning findings, repeated and colored warnings, allowances, malformed allow lists, and compile mode. |
| OPERATIONS.md | Documents the warning checks, the allow list, and how to force a rebuild without esphome clean. |
| .github/workflows/test-pull-request.yml | Builds the compile matrix from test/ and top-level configs, and runs the change gate for top-level YAML changes. |
Review effort: Lite
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
…List Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |


Closes two gaps in the compile gate that let warnings reach the dashboard unreported.
test/, so a lambda that exists only in a top-level device config was never linted. The matrix now liststest/*.yamland the top-level*.yamlconfigs, and the change gate runs the legs when a top-level config changes. Legs are named by config path.WARNINGline while ESPHome reads the config and generates code, and no compiler sees it. In--from-logand--compilemode the lint now reports each one as a finding on line 1 of the config, so it annotates, lands in the summary and the VS Code Problems pane, and fails the leg. It reads from the config read to the build path line, so toolchain retries during the build are not findings. A relative config path in a log resolves against the config root.tools/compile-lint/allowed-warnings.yaml. Each entry holds a regex matched against the warning's whole first line, the configs it applies to, and the reason. It starts with network and git cache fallbacks on any config, which refuse a permanent HTTP error, theesp32_improvdeprecation from the Konnected and Apollo packages, the CeilSense GPIO20 LED, and the WROOM-2 N32R8V experimental IDF opt-in.--verboselists what was allowed.OPERATIONS.md"Compile Lint" documents both, plus forcing a rebuild by deleting the build directory, sinceesphome cleanalso deletes the sharedpio_componentsand PlatformIO cache.Verified: 59 tests pass, ruff and pyright are clean, and the lint over fresh compile logs of all 32 configs on 2026.10.1 allows exactly the expected warnings. The gate fan findings it used to report were fixed by #280, now merged.
🤖 Generated with Claude Code