Skip to content

[NDGL-16] detekt, ktlint 적용 및 CI/CD 구성#7

Merged
mj010504 merged 20 commits into
developfrom
chore/NDGL-16
Jan 24, 2026
Merged

[NDGL-16] detekt, ktlint 적용 및 CI/CD 구성#7
mj010504 merged 20 commits into
developfrom
chore/NDGL-16

Conversation

@mj010504
Copy link
Copy Markdown
Contributor

@mj010504 mj010504 commented Jan 23, 2026

개요

  • detekt, ktlint 적용 및 CI/CD 구성

변경사항

  • 코드 품질 도구 도입: detekt, ktlint 추가
  • CI/CD 구성: Android CI workflow 파일 추가 (.github/workflows/android_ci.yml)
  • 빌드 설정 개선: build-logic 구조 수정 및 모든 모듈에 정적 분석 도구 적용
  • 코드 포맷팅: 기존 코드에 detekt, ktlint 규칙 적용

  • pre-commit에는 ./gradlew addKtlintCheckGitPreCommitHook를 통해 ktLintCheck를 수행하고 pre-push에는 detekt를 수행하는 방향으로 생각중입니다.

테스트 체크 리스트

  • ktlintCheck 빌드 성공
  • detekt 빌드 성공

Summary by CodeRabbit

릴리스 노트

  • Chores

    • 릴리스 빌드에서 난독화/최적화(isMinifyEnabled) 활성화로 앱 크기 및 배포 안전성 개선
    • CI 워크플로우 추가로 Android 빌드·검사 자동화(코드 스타일·정적분석 포함)
    • 프로젝트 전반에 정적분석 도구(Detekt, ktlint) 통합 및 설정 추가
  • Style

    • .editorconfig와 포맷팅 규칙 정립으로 코드 스타일 일관성 강화
    • 광범위한 코드 포맷 정규화(트레일링 컴마·공백 정리 등)

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

Walkthrough

코드 품질 도구(KtLint/Detekt) 및 CI 워크플로우 추가, 빌드 로직(플러그인) 재구성, 일부 릴리스 빌드 설정 및 여러 파일의 포맷/정리와 빈 파일 제거가 적용되었습니다.

Changes

코호트 / 파일(s) 변경 요약
코드 품질 설정
\.editorconfig, detekt-config.yml, gradle/libs.versions.toml, build.gradle.kts
EditorConfig·Detekt 구성 추가; Detekt/ktlint 플러그인 및 detekt-formatting 라이브러리 등록; 루트/서브프로젝트에 ktlint 및 detekt 설정 적용
CI 워크플로우
.github/workflows/android_ci.yml
GitHub Actions 워크플로우 추가: develop 브랜치 푸시/PR에 대해 ktlintCheck, detekt 및 Debug 빌드 실행
앱 빌드 설정
app/build.gradle.kts
release buildType에 isMinifyEnabled = true 추가
빌드-로직 리팩토링
build-logic/src/main/kotlin/... (NDGLAndroidLibraryPlugin.kt, NDGLApplicationPlugin.kt, NDGLDataPlugin.kt, NDGLFeaturePlugin.kt, NDGLKotlinLibraryPlugin.kt, convention/KotlinAndroid.kt, extensions/ProjectExtensions.kt)
기존 extensions 기반 Android/Library/Kotlin 설정 제거·재배치: ProjectExtensions.kt 삭제, 일부 configure* 호출 대체(예: configureAndroidLibrary()configureKotlinAndroid()), 플러그인 적용 흐름 재구성 및 detektPlugins 추가
루트/버전 카탈로그
gradle/libs.versions.toml
detekt 및 ktlint 관련 버전·플러그인·라이브러리 항목 추가
프로젝트 파일 삭제
core/util/src/main/java/com/yapp/util/Extensions.kt
Extensions 클래스 파일 삭제 (공개 타입 삭제)
로컬 설정 파일 추가
.claude/settings.local.json
로컬 Claude 설정(허용 git 명령 목록) 추가
UI/코드 포맷 정리
여러 UI/feature 파일 (app/src/..., core/ui/src/..., feature/*/src/..., navigation/src/..., core/util, core/ui)
불필요한 import 제거, 후행 쉼표 추가, 파라미터/함수 시그니처 포맷 정리, 빈 줄/개행 정리, 일부 ViewModel에서 @HiltViewModel 제거 또는 빈 바디 간소화 — 주로 포매팅/경량 변경
네비게이션/엔트리 등록
app/src/main/java/com/yapp/ndgl/ui/NDGLApp.kt, feature/travel/.../TravelEntry.kt, navigation/src/main/java/com/yapp/ndgl/navigation/NavigationState.kt
entryProvider 등록/순서 변경 및 import/포맷 재정렬 (동작 변화 없음)

Sequence Diagram(s)

(조건 미충족 — 변경은 주로 구성/포맷 및 리팩토링이며 새로운 다중 컴포넌트 제어 흐름을 도입하지 않음; 다이어그램 생략)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jihee-dev
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 요약하고 있습니다. detekt, ktlint 도구 적용 및 CI/CD 구성이라는 핵심 내용을 포함하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mj010504 mj010504 self-assigned this Jan 23, 2026
@mj010504 mj010504 requested a review from jihee-dev January 23, 2026 06:55
@YAPP-Github YAPP-Github deleted a comment from coderabbitai Bot Jan 23, 2026
@mj010504
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In @.github/workflows/android_ci.yml:
- Around line 42-43: Change the Gradle task invoked in the "Run build" job step:
replace the non-standard task name buildDebug with the standard Android Gradle
Plugin task assembleDebug. Update the run line that currently calls "./gradlew
buildDebug --stacktrace" to call "./gradlew assembleDebug --stacktrace" so the
workflow uses the official assembleDebug task.

In `@app/build.gradle.kts`:
- Around line 8-12: The release build sets isMinifyEnabled = true but does not
specify ProGuard rules; update the buildTypes { release { ... } } block to
include proguardFiles so the release minification uses the standard Android
proguard file and your project rules (e.g., add a call to
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")). Ensure this is placed alongside the existing
isMinifyEnabled = true in the release block so required classes are kept during
minification.

In `@detekt-config.yml`:
- Around line 78-88: The PackageNaming regex is allowing the literal '?'
character because of the character class `[_?A-Za-z0-9]*`; update the
packagePattern under PackageNaming to remove '?' from the character class so
only valid identifier characters are allowed (e.g., change the group
`(\._?[_?A-Za-z0-9]*)*` to use `_?[A-Za-z0-9]*` instead), ensuring the pattern
still matches dot-separated package segments but forbids '?' in package names.

In `@gradle/libs.versions.toml`:
- Around line 47-50: The ktlint-source version (ktlint-source = "0.50.0") is
incompatible with Kotlin 2.0; update the libs.versions.toml entry for
ktlint-source to a Kotlin-2-compatible release (use a 1.4.x or newer
ktlint-source version, e.g., set ktlint-source = "1.4.+"/a specific 1.4.x
release) so ktlint can parse Kotlin 2.0 syntax and metadata; after changing the
ktlint-source value, run the build/CI and ktlint tasks to verify no parsing
errors remain (look for the ktlint-source key to locate the change).
🧹 Nitpick comments (1)
.github/workflows/android_ci.yml (1)

16-31: Gradle 캐싱이 중복으로 설정되어 있습니다.

actions/cache@v4로 Gradle 캐시를 설정하고, actions/setup-java@v4에서도 cache: gradle을 사용하고 있어 캐싱이 중복됩니다. 둘 중 하나만 사용해도 충분합니다.

♻️ 중복 캐싱 제거 제안

actions/setup-java의 내장 캐싱 사용 (더 간단):

-    - name: Gradle cache
-      uses: actions/cache@v4
-      with:
-        path: |
-          ~/.gradle/caches
-          ~/.gradle/wrapper
-        key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
-        restore-keys: |
-          ${{ runner.os }}-gradle-
-
     - name: Set up JDK 21
       uses: actions/setup-java@v4
       with:
         java-version: '21'
         distribution: 'temurin'
         cache: gradle

또는 커스텀 캐시 키 유지가 필요하면 setup-java에서 cache 옵션을 제거하세요.

Comment thread .github/workflows/android_ci.yml Outdated
Comment thread app/build.gradle.kts
Comment on lines +8 to +12
buildTypes {
release {
isMinifyEnabled = true
}
}
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Jan 23, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

release 빌드에 ProGuard 설정이 누락되었습니다.

isMinifyEnabled = true를 설정했지만 ProGuard 파일이 지정되지 않았습니다. KotlinAndroid.kt에서 base 설정으로 isMinifyEnabled = false와 proguard 파일을 정의하고 있는데, 여기서 isMinifyEnabled = true로 override하면서 proguard 파일 설정이 누락되면 릴리스 빌드 시 필요한 코드가 제거될 수 있습니다.

🔧 ProGuard 파일 추가 제안
     buildTypes {
         release {
             isMinifyEnabled = true
+            proguardFiles(
+                getDefaultProguardFile("proguard-android-optimize.txt"),
+                "proguard-rules.pro",
+            )
         }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildTypes {
release {
isMinifyEnabled = true
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
🤖 Prompt for AI Agents
In `@app/build.gradle.kts` around lines 8 - 12, The release build sets
isMinifyEnabled = true but does not specify ProGuard rules; update the
buildTypes { release { ... } } block to include proguardFiles so the release
minification uses the standard Android proguard file and your project rules
(e.g., add a call to
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")). Ensure this is placed alongside the existing
isMinifyEnabled = true in the release block so required classes are kept during
minification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Project.configureKotlinAndroid()에 포함되어 있음

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the content of KotlinAndroid.kt to verify ProGuard configuration
cat build-logic/src/main/kotlin/convention/KotlinAndroid.kt

Length of output: 2093


@mj010504 맞습니다! 확인해보니 Project.configureKotlinAndroid()에서 이미 ProGuard 설정이 포함되어 있네요:

buildTypes {
    getByName("release") {
        isMinifyEnabled = false
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro",
        )
    }
}

기본 설정에서 ProGuard 파일이 지정되어 있고, app/build.gradle.kts에서는 isMinifyEnabledtrue로 override하는 것이므로 문제없습니다. 제 리뷰 코멘트가 잘못되었습니다. 설명해주셔서 감사합니다! 🙏

  (\__/)
  (•ᴗ•)
  />📚 Learning noted!

✏️ Learnings added
Learnt from: mj010504
Repo: YAPP-Github/27th-App-Team-1-Android PR: 7
File: app/build.gradle.kts:8-12
Timestamp: 2026-01-23T07:56:13.976Z
Learning: In the Android project using build-logic convention plugins, the `configureKotlinAndroid()` function in `build-logic/src/main/kotlin/convention/KotlinAndroid.kt` already configures ProGuard files for the release buildType. Individual modules can override just `isMinifyEnabled` without needing to re-specify the ProGuard files.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread detekt-config.yml Outdated
Comment thread gradle/libs.versions.toml
Base automatically changed from feature/NDGL-12 to develop January 24, 2026 05:48
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.claude/settings.local.json:
- Around line 1-8: The file .claude/settings.local.json contains local-only
settings (the permissions.allow array) but is committed; decide whether this
should be local-only or shared: if local-only, remove it from the repository and
add .claude/settings.local.json to .gitignore (preserve the permissions.allow
content locally before removing); if intended to be shared, rename to
.claude/settings.json (or split into settings.json + settings.local.json
pattern) and commit the shared file, ensuring the permissions.allow entries are
kept in the shared settings and any local overrides are moved to an ignored
local file.

In `@feature/auth/src/main/java/com/yapp/ndgl/feature/auth/AuthScreen.kt`:
- Around line 14-18: AuthRoute currently declares a viewModel parameter injected
via hiltViewModel() but never uses it; either remove the unused parameter from
AuthRoute (deleting "viewModel: AuthViewModel = hiltViewModel()") or explicitly
mark it as intentionally unused by adding `@Suppress`("UNUSED_PARAMETER") to
AuthRoute, or alternatively pass the viewModel into AuthScreen if it should be
used; reference the AuthRoute function and the AuthViewModel/hiltViewModel()
symbols when applying the change.
🧹 Nitpick comments (1)
feature/home/src/main/java/com/yapp/ndgl/feature/home/HomeScreen.kt (1)

14-17: 사용되지 않는 viewModel 파라미터가 있습니다.

viewModel 파라미터가 선언되었지만 HomeScreen()에 전달되지 않고 있습니다. 향후 구현을 위한 placeholder라면 괜찮지만, detekt/ktlint 규칙에서 미사용 파라미터 경고가 발생할 수 있습니다.

Comment on lines +1 to +8
{
"permissions": {
"allow": [
"Bash(git add:*)",
"Bash(git rebase:*)",
"Bash(git fetch:*)"
]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# 확인할 사항들
echo "=== .claude 디렉토리 구조 ==="
find .claude -type f 2>/dev/null | head -20

echo "=== .gitignore에서 .local 관련 항목 ==="
if [ -f .gitignore ]; then
  grep -i "local\|\.claude" .gitignore || echo "관련 항목 없음"
fi

echo "=== settings 관련 파일 확인 ==="
find . -name "*settings*" -type f 2>/dev/null | grep -v node_modules | head -20

echo "=== .claude 디렉토리 전체 파일 ==="
ls -la .claude 2>/dev/null || echo ".claude 디렉토리 없음"

Repository: YAPP-Github/27th-App-Team-1-Android

Length of output: 688


.claude/settings.local.json의 용도 명확히 필요

파일명의 "local" 접미사는 로컬 전용 설정을 의미하나, 현재 커밋되어 있어 프로젝트 관례와 불일치합니다. 다음 중 하나로 정리를 권장합니다:

  • 로컬 전용이면: .gitignore에 추가
  • 팀 공유 설정이면: settings.json으로 명명 변경 또는 공유/로컬 버전 분리
🤖 Prompt for AI Agents
In @.claude/settings.local.json around lines 1 - 8, The file
.claude/settings.local.json contains local-only settings (the permissions.allow
array) but is committed; decide whether this should be local-only or shared: if
local-only, remove it from the repository and add .claude/settings.local.json to
.gitignore (preserve the permissions.allow content locally before removing); if
intended to be shared, rename to .claude/settings.json (or split into
settings.json + settings.local.json pattern) and commit the shared file,
ensuring the permissions.allow entries are kept in the shared settings and any
local overrides are moved to an ignored local file.

Comment on lines 14 to 18
fun AuthRoute(
viewModel: AuthViewModel = hiltViewModel(),
) {

AuthScreen()
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

사용되지 않는 viewModel 파라미터

viewModelhiltViewModel()을 통해 주입되지만 함수 본문에서 사용되지 않습니다. 향후 구현을 위한 플레이스홀더라면 괜찮지만, 그렇지 않다면 제거하거나 @Suppress("UNUSED_PARAMETER")를 추가하여 의도를 명확히 하는 것이 좋습니다.

♻️ 의도적인 경우 제안
 `@Composable`
 fun AuthRoute(
+    `@Suppress`("UNUSED_PARAMETER")
     viewModel: AuthViewModel = hiltViewModel(),
 ) {
     AuthScreen()
 }
🤖 Prompt for AI Agents
In `@feature/auth/src/main/java/com/yapp/ndgl/feature/auth/AuthScreen.kt` around
lines 14 - 18, AuthRoute currently declares a viewModel parameter injected via
hiltViewModel() but never uses it; either remove the unused parameter from
AuthRoute (deleting "viewModel: AuthViewModel = hiltViewModel()") or explicitly
mark it as intentionally unused by adding `@Suppress`("UNUSED_PARAMETER") to
AuthRoute, or alternatively pass the viewModel into AuthScreen if it should be
used; reference the AuthRoute function and the AuthViewModel/hiltViewModel()
symbols when applying the change.

@mj010504 mj010504 merged commit 92e38f0 into develop Jan 24, 2026
2 checks passed
@mj010504 mj010504 deleted the chore/NDGL-16 branch January 24, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants