fix(auth)!: add an Android Lint workflow and gate the Kotlin modules on it - #2498
Conversation
There was a problem hiding this comment.
Code Review
This pull request integrates Android Lint into the build process by adding a repository-wide lintAll task, updating the CI scripts, and cleaning up module-specific lint baseline configurations. It also introduces logging optimizations using Log.isLoggable checks, refactors coroutine cancellation in AuthFlowController, adds nullability annotations to the database paging classes, and updates documentation regarding the new linting setup. The reviewer feedback highlights two key improvement opportunities: implementing equals and hashCode in DatabasePagingKey to ensure proper Paging 3 diffing and state restoration, and optimizing the QR code bitmap generation in QrCodeImage.kt by using bulk setPixels to reduce JNI overhead.
fe6962b to
9fcd7f0
Compare
9fcd7f0 to
0d104b2
Compare
0d104b2 to
64ce7cf
Compare
64ce7cf to
4f2b154
Compare
Every module configures Android Lint —
:authwithcheckAllWarningsandwarningsAsErrors— and nothing has ever invoked it.checkstyleis the only style gate the build knows about, and it is scopedinclude("**/*.java"), so on a Kotlin module like:authit inspects zero files and exits green. The first real run found 193 errors in:authand 5 in:database; every other module was already clean.lint.ymlworkflow runslintAll, a root task gating the eight modules that configure alint { }block. Deliberately not abuild.shstep: inline it took thebuildjob from 3-6 min to 8-11, and underset -ea lint failure aborted the run beforetestDebugUnitTest.:authfindings are fixed rather than suppressed —MemberExtensionConflict,NoOp, twoUseKtx,RedundantLabel, andVectorRasteron an icon that declared a 314dp intrinsic size where every sibling is 24dp.fui_confirmation_code_layout.xmlandfui_phone_layout.xmldeleted: both referenceSpacedEditText/CountryListSpinner, removed in 21a6823, so inflating either would throw.DatabasePagingKey.javagains@Nullableon the child value and node key. This narrows the Kotlin-visible type fromString!toString?, so it is a source-level break for Kotlin consumers — acceptable pre-GA, but calling it out.library/build.gradle.ktsflipsabortOnErrorto true; it wasfalse, so:librarywould have sat in the new gate unable to ever fail it.auth/lint-baseline.xml, so new findings still fail. The oldlibrary/quality/lint-baseline.xmlis removed — eight modules pointed at one file, but baseline paths are recorded per module, so its entries matched either every module or none.LogConditionalis disabled rather than satisfied: any enclosingifmeets it, so it flagged 5 of:auth's 23Log.dcalls, and guarding those withLog.isLoggablewould silence them by default.AuthMethodPicker'scustomLayoutmoves to the last parameter so it can be passed as a trailing lambda. Positional callers break at compile time, and because the JVM descriptor changed, callers using named arguments need a recompile too.EmailAuthStepisinternal, so the equivalent move there has no external effect.Maintainer note: Fixes internal CPRN-428