ci: verify Compose layout claims in the reference docs - #16
Merged
Conversation
…le verify blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Issue #14 (and four follow-ups) were docs asserting Compose layout behavior
that nothing executed — a wrong claim (
size(100).padding(16)→ "132x132")shipped green because no test ever composed the code and measured it. This adds
CI that runs and asserts the layout claims, with the docs as the single source
of truth so a claim and its test cannot drift apart.
How it works
A block in a reference
.mdis marked executable with averifyfence:The Gradle task
generateClaimTestsharvests everyverifyblock, emits oneRobolectric test per block, composes
Subject(), and asserts the measuredwidth/height — headless on the JVM, no emulator. A wrong number fails CI.
Plain
```kotlinblocks are illustrative and are not executed.What's here
verify-claims/— Android library module (Compose + Robolectric unit tests).buildSrc/—ClaimParser(unit-tested) +GenerateClaimTeststask.modifiers.md— the modifier invalid size and padding comment #14 size/padding examples annotated asverifyblocks..github/workflows/ci.yml— newverify-claimsjob (existingvalidatejob untouched).
CONTRIBUTING.md— how to author averifyblock.Verification (run locally)
./gradlew :verify-claims:testDebugUnitTest— 2 claim tests pass(132x132 and 100x100 confirmed by measurement).
size-first chain makes the test FAIL — exactly the guard that would have
caught modifier invalid size and padding comment #14.
./gradlew -p buildSrc test— 4 parser tests pass.Release (version bump + tag) will follow as a separate step after this merges.