HA Android Committing
Use this skill when finalizing a change and preparing it for commit or a pull request. For evaluating the code itself, use the ha-android-review skill.
Before Committing
- Format:
./gradlew :build-logic:convention:ktlintFormat ktlintFormat - Detekt:
./gradlew detektMain :build-logic:convention:detektMain --continue. Fix findings in the code you touched; never add them to adetekt-baseline*.xml(baselines only shrink as legacy findings get fixed). Refresh baselines with./gradlew detektBaselineMainonly when a rule change or detekt update invalidates them. - Tests:
./gradlew test - If the change adds a feature or changes behavior visibly for end users, add it to
app/src/main/kotlin/io/homeassistant/companion/android/changelog/ChangelogContent.kt. Small bug fixes don't get their own entry — the standing "Bug fixes and dependency updates" entry already covers them. - After adding or updating any dependency (in
gradle/libs.versions.tomlor module declarations), run./gradlew alldependencies --write-locks. - Run the
ha-android-reviewskill over the diff before handing it off.
Branch naming: feature/add-dark-mode, fix/crash-on-rotation.
Pull Requests
- Use
.github/pull_request_template.mdas the PR body. - Keep PRs small — easier to review, faster to merge. Break large changes into logical chunks; a reusable component (a new
HA*composable, a shared utility) deserves its own PR before the feature that uses it. - A PR must not contain changes unrelated to its purpose. Found a bug on the way? Open an issue and a separate PR. Revert incidental edits to files the change doesn't need.
- Pure refactor or code-move PRs must not change behavior — keep copied code as it was and fix pre-existing issues in follow-ups.
- Once a PR is open, merge
maininto the branch instead of rebasing. - Keep the PR description and screenshots up to date as the implementation evolves.
- Tests belong in the same PR as the implementation they cover, including tests moved along with moved logic.
- Features visible in
:appmust be verified on (or hidden from) Automotive and other form factors like Meta Quest. - When the Android Gradle Plugin is updated, refresh the lint baseline with
./gradlew updateLintBaseline. Never grow the baseline to silence an issue introduced by your change — fix the source or delete the unused resource instead.