Repository navigation
chore: AI-coding ruleset, only-new lint/checkstyle gate and API check - #68
Merged
Merged
Conversation
AGENTS.md (with CLAUDE.md importing it), rules for code conventions, tests and code that runs in the customer's app, Claude Code settings with a per-edit compile hook and a stop hook, a test-writer agent and a review command. quality/lint-new.sh judges only what a branch adds: Android Lint findings beyond quality/lint-baseline.xml (291 for the code today), Checkstyle findings on added lines, and with --api japicmp against the base's build (fails on an incompatible change to quality/public-api.txt, lists the rest). The tools are added through quality/quality.init.gradle for these runs only: no build file changes. CI pins actions by SHA, builds the sample app and runs the on-device tests on an emulator; quality.yml runs the gate on PRs with the base branch's quality/. git push runs the gate (.githooks/pre-push, installed with .githooks/install.sh). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TobiasDuelli
marked this pull request as ready for review
November 19, 2026 09:26
LucaB01
approved these changes
Nov 19, 2026
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.
Brings the AI-coding ruleset and quality setup of the other Gleap repos to the Android SDK, translated to Java and Android: Android Lint, Checkstyle and japicmp through the Gradle wrapper, with the same principle that a branch is judged only on what it adds. No SDK code, no build file,
gradle.properties, wrapper, ProGuard file orrelease.ymlchanges: the tools are added by a Gradle init script for the quality runs only, and the published artifacts build byte-identical (below).The kit
AGENTS.md,CLAUDE.md(@AGENTS.md)Gleap,io.gleap.callbacks.*and what the Flutter and React Native SDKs import; technically public internals (GleapSessionController,GleapIdentifyService, …) are named as not API. Traps found while reading: Java 8 + min SDK 21 without desugaring,returnDefaultValuesin unit tests, the testorg.json,VERSION_NAMEinBuildConfig, no consumer R8 rules, resources merging into apps, the publish plugin pinning Gradle/AGP.claude/rules/code-conventions.mdGleapLog,GleapHttp/GleapExecutor,GleapMainThread,GleapErrors.guard,org.json,KeyValueStore; null annotations and Javadoc on public API (Kotlin interop guide).claude/rules/host-app.md(new)GleapWidgetBridge,GleapExternalLinks,GleapProtectedFiles,GleapNetworkLogSanitizer,usesKeyboardPaddingOnly).claude/rules/testing.mdSdkTestEnvironment/FakeGleapServerand the*ForTestingseams; on-device tests onE2ETestBasewith the network guard; no Mockito/Robolectric without asking.claude/settings.json,.claude/hooks/*.shquality/lint-new.sh, the unit tests and a compile of the sample app (≈6 s warm)jq; blocks once per unchanged tree. Runs in the worktree the file or session is in. Denieslocal.properties, keystores,~/.gradle/gradle.properties, anypublish*/*MavenCentral*task,git tag, tag pushes,gh release.claude/agents/test-writer.md,.claude/commands/review.md.githooks/pre-push,.githooks/install.shgit pushrunsquality/lint-new.sh; installed once withsh .githooks/install.shpnpm install'spreparequality/quality.init.gradle:gleaponly for runs that pass it with-I: lint config (infinalizeDsl, elsegleap/build.gradle'slint { abortOnError false }wins), a Checkstyle task, two japicmp tasks:gleap:tasks --allwithout-Ilists noquality*task)quality/lint-new.shorigin/master; exit 0 nothing new, 1 findings, 2 could not runquality/lint.xml,quality/lint-baseline.xmlquality/checkstyle.xmlandroid.util.Log/AsyncTaskimports,printStackTrace/System.out, Javadoc on public types and methods, empty catch,equals/hashCode, string==, switch default, fall-throughquality/public-api.txtGleapand the types in its signatures.github/workflows/ci.ymlassembleRelease,:app:assembleDebug(new), and a new on-device job:connectedDebugAndroidTeston an API 34 emulator.github/workflows/quality.ymlquality/lint-new.sh --apion PRs with the base branch'squality/Only new
lint-new.shcounts each (issue, message, file) againstquality/lint-baseline.xmland fails on any finding beyond those counts. Of several findings with the same message in a file, the ones on lines the branch added or changed are reported as the new ones. Lint's own baseline matches by issue, message and file only (checked inLintBaseline): with 264 identical "Unknown nullability" findings, a new one was reported at an old method, which would have sent an agent to annotate old public API.git diff -U0against the merge base, uncommitted and untracked files included).--api) builds the merge base fromgit archiveand compares the twoclasses.jar: a binary or source incompatible change toquality/public-api.txtfails, one to another public class is listed. Adding a method to a callback interface is source incompatible and fails.Checks run
On this branch, JDK 17 (
/usr/libexec/java_home -v 17), warm Gradle:sh quality/lint-new.shUnknownNullnessandDefaultLocaleat the new method inGleap.java,UnknownNullnessat a new callback method; CheckstyleParameterNumber,EmptyCatchBlock,IllegalImport(android.util.Log),printStackTrace,MissingJavadocMethodon the added linesGleapMainActivity.java(1069 lines, 14 empty catches): nothing reported. 291 old lint findings: nothing reportedsh quality/lint-new.sh --apiMETHOD_ADDED_TO_INTERFACEonWidgetOpenedCallback;GleapSessionController.executePendingUpdatesmade package-private is listed, not failed; the newGleapmethod is listed as compatible.githooks/pre-push(stdin as git sends it){"stop_hook_active": …, "cwd": …})MainApplication.java:66); withstop_hook_activeand an unchanged tree: exit 0{"tool_input": {"file_path": …}})strings.xml; a Gradle that cannot start (badJAVA_HOME) only adds a note.githooks/install.sh./gradlew :gleap:testDebugUnitTest :gleap:assembleRelease :app:assembleDebug :gleap:assembleDebugAndroidTestGleapRegionTest, named in the stop hook's outputThe scripts run under
dashtoo (Ubuntu'ssh).CI on this PR, all green: Quality 1m05s (this PR brings
quality/, so it ran its own copy;--apibuilt the base: nothing new, plus the expected warning that the PR changes the checks), Unit tests and release build 1m22s (271 unit tests,assembleRelease,:app:assembleDebug), On-device tests (emulator) 3m14s: the emulator booted in 33 s and all 8 on-device tests passed in 26 s, so the job needs nocontinue-on-error.Published artifacts: byte-identical
Built from clean
git archivecopies with JDK 17:origin/master(bc94d85) twice to measure noise, this branch once.outputs/aar/gleap-release.aardb60225373ab2bbaintermediates/source_jar/release/release-sources.jarb77555b51d6dbc8epublications/maven/pom-default.xml967738fd41b49a57publications/maven/module.jsona9dd52613669960dNoise is zero: AGP writes the AAR's entries with a fixed date (1980-02-01) and a fixed order; a rebuild with JDK 18 gave the same bytes too. The
.ascsignatures differ on every release by design and are not compared.Research: adopted and rejected
UnknownNullness,LambdaLast, …)google_apis(has a WebView)stop_hook_activestops loopsDev tools added
All through Gradle, nothing in a build file or
gradle.properties: Checkstyle 12.3.1, japicmp 0.27.0 (jar-with-dependencies). Android Lint is AGP 8.8.0's. Actions pinned by SHA:actions/checkoutv7.0.1,actions/setup-javav6.3.0,gradle/actions/setup-gradlev5.0.2,reactivecircus/android-emulator-runnerv2.38.0,actions/upload-artifactv7.0.2. Needsjqfor the hooks (CI runners and macOS ship it).Found while setting up (not fixed here)
NewApiinGleapMainActivity.java:295(setOnScrollChangeListener, API 23), is guarded indirectly:usesKeyboardPaddingOnly()is true only from API 35. In the baseline.SetJavaScriptEnabled(3),RtlHardcoded(4),ObsoleteSdkInt(3),PrivateApi/DiscouragedPrivateApi(4),StaticFieldLeak(HttpHelper.context),InlinedApi,DefaultLocale(GleapConfig), and others. Full list inquality/lint-baseline.xml.:appcompiles against SDK 34 but targets 36, and uses okhttp 4.2.2 andandroid.support.testas its runner name.Not in this PR
CIandQualitycould become required checks.🤖 Generated with Claude Code