Skip to content

Conversation

@raghavsatyadev
Copy link
Owner

  • 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.
Copilot AI review requested due to automatic review settings November 6, 2025 17:31
Copy link

Copilot AI left a 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.yml optimized 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 cat command 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 with cat \"$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.md report by default. Based on the configured reports in core/build.gradle.kts (html, xml, txt), the available report files would be detekt.html, detekt.xml, or detekt.txt. Change this to reference an actual generated report file, such as core/build/reports/detekt/detekt.txt or core/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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants