diff --git a/.claude/skills/preflight/SKILL.md b/.claude/skills/preflight/SKILL.md index 6bd417a..71d580b 100644 --- a/.claude/skills/preflight/SKILL.md +++ b/.claude/skills/preflight/SKILL.md @@ -1,6 +1,6 @@ --- name: preflight -description: Run LibreMail's fast CI gate locally (assembleDebug + testDebugUnitTest + lintDebug + ktlintCheck + detekt) before pushing or opening a PR. Mirrors the merge gate; does NOT run emulator E2E. Use before treating a change as done. +description: Run LibreMail's fast CI gate locally (assembleDebug + testDebugUnitTest + compileDebugAndroidTestKotlin + lintDebug + ktlintCheck + detekt) before pushing or opening a PR. Mirrors the merge gate; does NOT run emulator E2E. Use before treating a change as done. --- # /preflight @@ -21,10 +21,16 @@ Run these, stopping at the first failure: ```bash ./gradlew :app:assembleDebug ./gradlew :app:testDebugUnitTest +./gradlew :app:compileDebugAndroidTestKotlin ./gradlew :app:lintDebug ./gradlew :app:ktlintCheck :app:detekt ``` +`compileDebugAndroidTestKotlin` compiles the `androidTest` source set — the E2E/instrumented +tests — without needing an emulator. `assembleDebug`, `testDebugUnitTest`, and `lintDebug` never +compile that source set, so a change that breaks it (e.g. an instrumented test calling a UI API +that just changed signature) passes the rest of this gate locally yet fails CI. + `ktlintCheck` + `detekt` are exactly what CI's **Static analysis** job runs — they cover the `test`/`androidTest` source sets that `lintDebug` does not, so a style violation there fails the merge gate even when the build and lint are green. Add `--continue` to any command (e.g. diff --git a/CLAUDE.md b/CLAUDE.md index 8c0bcf7..18a3db8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,10 +26,12 @@ or via Gradle Managed Devices `./gradlew e2eGroupDebugAndroidTest` (whole matrix `app/build.gradle.kts` must stay in lockstep with the E2E matrix in `.github/workflows/ci.yml`. **Before treating a change as done**, run the fast CI gate: `assembleDebug` + -`testDebugUnitTest` + `lintDebug` + `ktlintCheck` + `detekt` (the `/preflight` skill does -this). `ktlintCheck`/`detekt` cover the `test`/`androidTest` source sets that `lintDebug` -skips, so they catch style violations that would otherwise fail CI's Static analysis gate. -Emulator E2E is left to CI unless asked. +`testDebugUnitTest` + `compileDebugAndroidTestKotlin` + `lintDebug` + `ktlintCheck` + +`detekt` (the `/preflight` skill does this). `compileDebugAndroidTestKotlin` compiles the +`androidTest` source set that the rest of the gate skips, catching E2E/instrumented-test +compile errors before they surface only in CI. `ktlintCheck`/`detekt` cover the +`test`/`androidTest` source sets that `lintDebug` skips, so they catch style violations that +would otherwise fail CI's Static analysis gate. Emulator E2E is left to CI unless asked. ## Build-config gotchas