-
Notifications
You must be signed in to change notification settings - Fork 0
Detekt workflow #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
raghavsatyadev
commented
Nov 6, 2025
- Add detekt configuration and detekt github workflow
- Run detekt on PR actions like opened, reopened, synchronised - baseline for detekt has been setup
- Simplified the `detekt.yml` configuration by removing many commented-out and default rules, focusing on a stricter, more relevant ruleset. - Increased `maxIssues` to 10. - Disabled several complexity and naming rules (e.g., `LongMethod`, `LongParameterList`, `FunctionNaming`) that are less applicable to Jetpack Compose code. - Updated the Detekt baseline to reflect the new configuration. - Streamlined the Detekt step in the `pr_tests.yml` GitHub workflow.
Renamed the `pr_tests.yml` workflow file to `ci.yml` for clarity. Also, corrected the Detekt summary output to properly format it as a markdown code block in the workflow log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates Detekt static code analysis into the project to enforce code quality standards. Detekt is configured with custom rules tailored for Compose/Kotlin Multiplatform development and includes a baseline file to track existing issues.
- Adds Detekt plugin version 1.23.8 to the project
- Configures Detekt with custom rules in
detekt.ymloptimized for Compose projects - Integrates Detekt checks into the CI/CD pipeline
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Adds Detekt plugin version 1.23.8 and plugin dependency |
| detekt.yml | Defines Detekt configuration with Compose-specific rules (max line length 150, disabled function naming for Composables) |
| core/detekt-baseline.xml | Establishes baseline of 250 existing code issues to be addressed incrementally |
| core/build.gradle.kts | Configures Detekt for multiplatform source sets with HTML, XML, and TXT report generation |
| build.gradle.kts | Applies Detekt plugin at root level |
| .github/workflows/ci.yml | Adds Detekt execution step to CI pipeline with summary reporting |
Comments suppressed due to low confidence (2)
.github/workflows/ci.yml:47
- The
catcommand is being used incorrectly. The backticks and markdown formatting should not be inside the string passed to cat. The file content should be displayed directly withcat \"$SUMMARY_MD\", and the markdown code fence should wrap the entire output block instead.
.github/workflows/ci.yml:44 - Detekt does not generate a
detekt.mdreport by default. Based on the configured reports incore/build.gradle.kts(html, xml, txt), the available report files would bedetekt.html,detekt.xml, ordetekt.txt. Change this to reference an actual generated report file, such ascore/build/reports/detekt/detekt.txtorcore/build/reports/detekt/detekt.html.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Moves the `Run unit tests` step to execute after the Detekt analysis steps to reject the PR early if it has any code smells.
The Detekt summary is now outputted to the GitHub Step Summary for better visibility in the workflow run.
Removes most of the custom detekt configuration, opting for detekt's defaults. The maximum issue count is increased to 500 to allow the build to pass, and the baseline file has been cleared.