Skip to content

[Fix/#12] ktlint적용시 어노테이션이 붙은 생성자에 대해 자동 줄바꿈을 하던 부분 수정#13

Merged
l5x5l merged 4 commits intodevelopfrom
hotfix/#12-ktlint_annotation_contrsuctor
Jun 29, 2025
Merged

[Fix/#12] ktlint적용시 어노테이션이 붙은 생성자에 대해 자동 줄바꿈을 하던 부분 수정#13
l5x5l merged 4 commits intodevelopfrom
hotfix/#12-ktlint_annotation_contrsuctor

Conversation

@l5x5l
Copy link
Copy Markdown
Contributor

@l5x5l l5x5l commented Jun 25, 2025

[ PR Content ]

ktlint 적용시 Inject와 같은 어노테이션이 붙은 생성자에 대해 자동 줄바꿈을 하던 문제를 수정했습니다.

Related issue

Screenshot 📸

x

Work Description

  • .editorconfig 파일을 수정하여 이젠 어노테이션 관련해서 ktlint 규칙을 적용하지 않습니다.

To Reviewers 📢

  • 이전 프로젝트에서는 이런 경험이 없었어서 비교해봤더니, "org.jlleitschuh.gradle.ktlint" 플러그인에 대해 이전 프로젝트는 11.3.2 버젼을, 현재 프로젝트는 12.3.0 버젼을 사용하고 있었습니다.
  • 버젼을 바꿔가며 적용해본 결과, 어노테이션이 붙은 생성자 관련한 문제는 12.0.0부터 발생했습니다.
  • "org.jlleitschuh.gradle.ktlint" 플러그인이 11.6.3에서 12.0.0으로 업데이트되면서 해당 플러그인에서 사용하는 "com.pinterest.ktlint:ktlint-core" ktlint 라이브러리의 버젼이 올라감을 확인했기에, 해당 부분에서 발생한 차이점이라고 판단됩니다.

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Kotlin 파일에 대한 코드 스타일 설정이 업데이트되었습니다.
    • 표준 annotation 검사(ktlint_standard_annotation)가 비활성화되었습니다.
    • ktlint 플러그인 버전이 12.3.0에서 11.3.2로 다운그레이드되었습니다.

@l5x5l l5x5l requested a review from wjdrjs00 June 25, 2025 11:22
@l5x5l l5x5l self-assigned this Jun 25, 2025
@l5x5l l5x5l added 🐞 Fix 버그 수정 세환 labels Jun 25, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 25, 2025

"""

Walkthrough

.editorconfig 파일에 Kotlin 관련 설정으로 ij_kotlin_allow_trailing_comma_on_call_site = truektlint_standard_annotation = disabled가 추가되었으며, ktlint_function_naming_ignore_when_annotated_with=Composable 설정은 위치만 변경되었습니다. 또한 gradle/libs.versions.toml에서 ktlint 버전이 12.3.0에서 11.3.2로 다운그레이드되었습니다.

Changes

파일/경로 변경 요약
.editorconfig Kotlin 설정에 ij_kotlin_allow_trailing_comma_on_call_site = truektlint_standard_annotation = disabled 추가, 기존 설정 위치 조정
gradle/libs.versions.toml ktlint 플러그인 버전을 12.3.0에서 11.3.2로 다운그레이드

Sequence Diagram(s)

(해당 변경은 설정 및 버전 변경에 국한되어 있으므로 시퀀스 다이어그램 생략)

Assessment against linked issues

Objective Addressed Explanation
.editorconfig 파일 수정으로 어노테이션이 붙은 constructor에 대해 줄바꿈이 발생하지 않도록 함 (#12)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
ktlint 플러그인 버전 다운그레이드 (gradle/libs.versions.toml) 이 변경은 linked issue #12의 요구사항과 직접 관련 없음

Poem

토끼가 뛰노는 코틀린 숲,
줄바꿈 버그는 이젠 굿!
.editorconfig에 한 줄 추가,
어노테이션 constructor 줄이 쭉쭉 이어져,
ktlint도 토끼도 모두가 웃는 밤!
🐰✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 367776d and cc42214.

📒 Files selected for processing (7)
  • core/datastore/src/main/java/com/threegap/bitnagil/datastore/serializer/AuthTokenSerializer.kt (1 hunks)
  • core/datastore/src/main/java/com/threegap/bitnagil/datastore/storage/AuthTokenDataStoreImpl.kt (1 hunks)
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/Type.kt (1 hunks)
  • gradle/libs.versions.toml (1 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt (1 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/login/LoginScreen.kt (2 hunks)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/login/LoginViewModel.kt (1 hunks)
✅ Files skipped from review due to trivial changes (6)
  • presentation/src/main/java/com/threegap/bitnagil/presentation/home/HomeScreen.kt
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/Type.kt
  • presentation/src/main/java/com/threegap/bitnagil/presentation/login/LoginScreen.kt
  • presentation/src/main/java/com/threegap/bitnagil/presentation/login/LoginViewModel.kt
  • core/datastore/src/main/java/com/threegap/bitnagil/datastore/storage/AuthTokenDataStoreImpl.kt
  • core/datastore/src/main/java/com/threegap/bitnagil/datastore/serializer/AuthTokenSerializer.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • gradle/libs.versions.toml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
✨ 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (1)
.editorconfig (1)

16-16: ktlint_standard_annotation = disabled 추가는 올바르지만, 하위 버전 호환성도 고려하세요
ktlint 0.48+ 계열에서는 ktlint_<ruleset>_<rule> 형식(예: ktlint_standard_annotation)으로 규칙을 끄는 방식이 맞습니다. 다만 레거시(11.x) 플러그인을 병행 사용하거나, CI 캐시 등에 구버전 ktlint가 남아 있을 경우 속성이 무시돼 다시 포맷이 깨질 수 있습니다.

  • 구버전 호환이 필요하면 ktlint_disabled_rules=annotation 방식도 병행 기재를 검토해보세요.
  • 팀 전체가 12.0.0+로 통일됐는지 한 번 더 확인을 권장드립니다.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08fc652 and 2a972a0.

📒 Files selected for processing (1)
  • .editorconfig (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (1)
.editorconfig (1)

15-15: ktlint_function_naming_ignore_when_annotated_with 설정 유지 확인 완료
기존 설정이 그대로 유지되어, @Composable 함수의 네이밍 검사 예외가 정상 동작할 것으로 보입니다. 별다른 문제 없습니다.

@l5x5l
Copy link
Copy Markdown
Contributor Author

l5x5l commented Jun 28, 2025

ktlint_code_style=android_studio 적용시 아래처럼 인터페이스, 들여쓰기 관련 추상 클래스를 명시할 때 기존 스타일과 다른 부분이 존재합니다.

@HiltViewModel
class HomeViewModel @Inject constructor(
    savedStateHandle: SavedStateHandle,
    initState: HomeState,
) : MviViewModel<HomeState, HomeSideEffect, HomeIntent>(
        initState,
        savedStateHandle,
    ), // <- 여기
    HomeSampleInterface {
    override suspend fun SimpleSyntax<HomeState, HomeSideEffect>.reduceState(
        intent: HomeIntent,
        state: HomeState,
    ): HomeState? {
        TODO("Not yet implemented")
    }
}

위 옵션을 disable하는 방법을 찾지 못해 일단 이전 버전 11.3.2 로 사용하기로 했습니다. 😢

Copy link
Copy Markdown
Member

@wjdrjs00 wjdrjs00 left a comment

Choose a reason for hiding this comment

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

굿~! 고생하셨습니다 👍🏻

@l5x5l l5x5l merged commit 64a06e2 into develop Jun 29, 2025
2 checks passed
@wjdrjs00 wjdrjs00 deleted the hotfix/#12-ktlint_annotation_contrsuctor branch July 6, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

세환 🐞 Fix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] ktlint annotation contructor 관련 수정

2 participants