Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
adalpari
left a comment
There was a problem hiding this comment.
Nice improvement, LGTM and works as expected!
There was a problem hiding this comment.
Pull request overview
Adds Detekt-based static analysis to the Android/Kotlin portion of the repo and wires it into local tooling + Buildkite CI, bringing Android in line with existing JS/Swift linting.
Changes:
- Add Detekt Gradle plugin (via version catalog) and apply/configure it across Android subprojects.
- Introduce a shared
android/detekt.ymlconfig and module baselines to avoid blocking on existing violations. - Add
make lint-androidand a corresponding Buildkite step.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| android/gradle/libs.versions.toml | Adds Detekt plugin + version to the Android version catalog. |
| android/detekt.yml | Defines the repo’s initial Detekt rule configuration and thresholds. |
| android/build.gradle.kts | Applies Detekt to Android subprojects and points to shared config + per-module baseline. |
| android/app/detekt-baseline.xml | Baselines existing Detekt findings for the app module. |
| android/Gutenberg/detekt-baseline.xml | Baselines existing Detekt findings for the Gutenberg library module. |
| Makefile | Adds lint-android target to run Detekt consistently locally/CI. |
| .buildkite/pipeline.yml | Adds an Android lint step to CI using make lint-android. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ParaskP7
left a comment
There was a problem hiding this comment.
👋 @jkmassel thanks for adding Detekt on this repo for Android, and for the ping! 🥇
I am approving this as well, with just a few suggestions for you:
- Suggestion (💡): I see version 1.23.7 (
Sep 8, 2024) being used, with a newer 1.23.8 (Feb 21, 2025) being available. I am not sure why 1.23.7 got chosen, so maybe consider using the newest 1.X version instead. FYI: There is also a couple ofalpha2.X versions available, but I would go that far. - Suggestion (💡): The
appbaseline contain 18 FunctionNaming entries for@Composablefunctions (e.g.AddConfigurationDialog,EditorScreen). Compose conventions require PascalCase for composable functions, which conflicts with Detekt's default camelCase rule. Rather than baselining all of these, consider adding this configuration todetekt.yml, which will then eliminate those baseline entries and prevent future false positives on new composables.:
naming:
FunctionNaming:
ignoreAnnotated:
- 'Composable'- Minor (🔍): I see a few options being configured already, but maybe you want to check/add more options for Detekt, like
parallel, etc: https://detekt.dev/docs/1.23.6/gettingstarted/gradle#options-for-detekt-configuration-closure - Minor (🔍): The
appbaseline has 5NewLineAtEndOfFileentries. These are trivial one-line fixes (just add a newline at EOF). Could be fixed immediately rather than baselined, to keep the baseline cleaner.
Everything else LGTM! 🚀
Fixes five Kotlin files that were missing a trailing newline, and removes the corresponding NewLineAtEndOfFile entries from the detekt baseline.
Compose convention requires PascalCase for composable functions, which conflicts with Detekt's default camelCase rule. Adding ignoreAnnotated for @composable removes 18 false-positive baseline entries and prevents future false positives on new composables.
|
@ParaskP7 to avoid this becoming stale, I addressed three of the four suggestions in #388 (review). I plan to merge this as-is. Thank you for the valuable feedback.
@jkmassel I suggest we can follow up on the remaining suggestion (expanding Detekt configuration with options like |
|
Awesome, thanks @dcalhoun ! 🙇 ❤️ 🚀 |
What?
Adds Detekt static analysis for Android/Kotlin code and a corresponding Buildkite CI step.
Why?
The JavaScript and Swift sides of the project already have linting in CI (ESLint, SwiftLint), but Android had no static analysis. This closes that gap so Kotlin code quality issues are caught in CI.
Next Steps
In a future PR we can address the baseline issues, I just wanted to get this started for now.
How?
android/detekt.ymlwith tuned thresholds for the codebasedetekt-baseline.xml) for both theGutenberglibrary andappmodules so existing violations don't block CI — new violations will be caught going forwardmake lint-androidtarget (runs./gradlew detekt):android: Lint Androidstep to the Buildkite pipeline on theandroidqueueTesting Instructions
make lint-android— should pass with no errors.make lint-androidcatches it.🤖 Generated with Claude Code