Document marking leaf component and automation classes as final#157
Document marking leaf component and automation classes as final#157jesserockz wants to merge 1 commit into
Conversation
Adds a coding standard and example updates instructing contributors to mark leaf component/platform classes and Action/Trigger/Condition primitives with the C++ final specifier, matching esphome/esphome#16952.
✅ Deploy Preview for esphome-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Documents the project-wide C++ convention of marking leaf (non-subclassed in-tree) component/platform classes and automation primitives (Action/Trigger/Condition) as final, including rationale and examples.
Changes:
- Adds a new coding-standard subsection describing when/how to apply
finalto leaf classes. - Updates the canonical
ExampleComponentdocs example to befinaland cross-links the new guideline. - Updates automation primitive examples to be
finaland adds an explanatory note.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/contributing/code.md | Adds a new guideline section documenting the final convention and rationale. |
| docs/architecture/components/index.md | Marks ExampleComponent as final and links to the new guideline. |
| docs/architecture/components/automations.md | Documents and updates automation primitive examples to be final. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Review — Document marking leaf component and automation classes as finalClean, well-scoped docs PR. Merge-ready.
Automated review by Kōan (Claude) |
esphbot
left a comment
There was a problem hiding this comment.
No blocking issues found.
Summary
Documents the C++
finalconvention introduced across the esphome/esphome#16952 PR series, which marks leaf, user-configurable component classes and automationAction/Trigger/Conditionprimitives asfinal.final" coding-standard subsection todocs/contributing/code.md, covering the rule, the "leaf only" caveat (hubs and base*Componentclasses excluded), and the rationale (API hardening / developer breaking change, intent, devirtualization).ExampleComponentexamplefinalindocs/architecture/components/index.mdwith a cross-linked note.Action/Trigger/Conditionexamplesfinalindocs/architecture/components/automations.mdand adds an explanatory note.Entity base-class docs (sensor, switch, etc.) are intentionally left untouched, since those classes are meant to be subclassed and must not be
final.