Skip to content

CI : Integrate ktlint into Github Actions#7

Merged
DongChyeon merged 2 commits intomainfrom
chore/#6-setup-ktlint-ci
May 29, 2025
Merged

CI : Integrate ktlint into Github Actions#7
DongChyeon merged 2 commits intomainfrom
chore/#6-setup-ktlint-ci

Conversation

@DongChyeon
Copy link
Owner

Add ktlint check to CI workflow to enforce consistent code style
CI will now fail if ktlint format violations are found

@DongChyeon DongChyeon requested a review from Copilot May 29, 2025 02:02
@DongChyeon DongChyeon self-assigned this May 29, 2025
@DongChyeon DongChyeon added the Feature New feature or request label May 29, 2025
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

Adds ktlint to the Gradle version catalog and updates the GitHub Actions CI workflow to run ktlint style checks as part of the build.

  • Introduces a ktlint version and plugin alias in libs.versions.toml
  • Creates/updates the Android CI workflow to run ktlintCheck alongside assembleDebug

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
gradle/libs.versions.toml Added ktlint version and plugin alias to version catalog
.github/workflows/android_ci.yml New CI workflow runs ktlintCheck then builds the app
Comments suppressed due to low confidence (2)

.github/workflows/android_ci.yml:9

  • The CI trigger only covers *.kt files. Consider adding **/*.kts to also rerun CI when Kotlin script files change.
-      - '**/*.kt'

.github/workflows/android_ci.yml:53

  • This job runs lint and assemble but doesn't execute unit tests. Consider adding a test or check task to ensure full code validation.
run: ./gradlew ktlintCheck assembleDebug

Comment on lines 42 to +46
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "agp" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
Copy link

Copilot AI May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The plugin aliases list is not alphabetically ordered. Consider reordering entries to keep the version catalog organized.

Suggested change
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "agp" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
android-library = { id = "com.android.library", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }

Copilot uses AI. Check for mistakes.
@DongChyeon DongChyeon force-pushed the chore/#6-setup-ktlint-ci branch from 38ab874 to 042618f Compare May 29, 2025 02:10
@DongChyeon DongChyeon force-pushed the chore/#6-setup-ktlint-ci branch from 042618f to ebf7d9f Compare May 29, 2025 02:11
@DongChyeon DongChyeon merged commit 7c14453 into main May 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants