Skip to content

chore: swiftlint & coderabbit 세팅#21

Merged
clxxrlove merged 5 commits into
developfrom
BOOK-41-chore/#20
Jun 17, 2025
Merged

chore: swiftlint & coderabbit 세팅#21
clxxrlove merged 5 commits into
developfrom
BOOK-41-chore/#20

Conversation

@doyeonk429
Copy link
Copy Markdown
Member

@doyeonk429 doyeonk429 commented Jun 17, 2025

🔗 관련 이슈

📘 작업 유형

  • ✨ Feature (기능 추가)
  • 🐞 Bugfix (버그 수정)
  • 🔧 Refactor (코드 리팩토링)
  • ⚙️ Chore (환경 설정)
  • 📝 Docs (문서 작성 및 수정)
  • ✅ Test (기능 테스트)
  • 🎨 style (코드 스타일 수정)

📙 작업 내역

  • swiftlint script 추가
  • codeRabbit 설정 yaml파일 추가

🧪 테스트 내역

  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

✅ PR 체크리스트

  • 커밋 메시지가 명확합니다
  • PR 제목이 컨벤션에 맞습니다
  • 관련 이슈 번호를 작성했습니다
  • 기능이 정상적으로 작동합니다
  • 불필요한 코드를 제거했습니다

💬 추가 설명 or 리뷰 포인트 (선택)

  • ..

Summary by CodeRabbit

  • 새로운 기능

    • SwiftLint 코드 검사 도구가 프로젝트 전체에 통합되어, 코드 품질 및 일관성이 향상되었습니다.
    • 새로운 설정 파일(.coderabbit.yaml)이 추가되어 리뷰, 언어(한국어), 챗봇, 코드 분석 도구 등이 활성화되었습니다.
  • 문서

    • 테스트 관련 문서 파일이 삭제되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 17, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

SwiftLint 설정 파일이 추가되고, 각 프로젝트의 주요 타겟에 SwiftLint 빌드 스크립트가 통합되었습니다. SwiftLint 스크립트는 ProjectDescriptionHelpers에 생성되었으며, 환경 변수 및 실행 경로도 설정되었습니다. 추가적으로, 불필요한 테스트 문서가 삭제되었습니다.

Changes

파일/그룹 변경 요약
.coderabbit.yaml 코드 리뷰, 도구, 언어(ko-KR) 등 다양한 설정이 포함된 신규 설정 파일 추가
src/.swiftlint.yml SwiftLint 규칙 및 커스텀 룰이 포함된 신규 설정 파일 추가
src/Projects/BKCore/Project.swift
src/Projects/BKData/Project.swift
src/Projects/BKDesign/Project.swift
src/Projects/BKDomain/Project.swift
src/Projects/BKNetwork/Project.swift
src/Projects/BKPresentation/Project.swift
src/Projects/BKStorage/Project.swift
src/Projects/Booket/Project.swift
각 프로젝트 타겟에 swiftLintScript를 scripts 배열에 추가하여 SwiftLint 빌드 스크립트 통합
src/Tuist/ProjectDescriptionHelpers/SwiftLintScript.swift SwiftLint 실행을 위한 TargetScript 공개 상수 swiftLintScript 신규 추가 및 스크립트 구현
test.md 테스트 관련 문서 파일 삭제

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant BuildSystem
    participant SwiftLint

    Developer->>BuildSystem: 프로젝트 빌드 시작
    BuildSystem->>SwiftLint: SwiftLint 스크립트 실행 (사전 빌드)
    SwiftLint-->>BuildSystem: 코드 스타일 검사 및 결과 반환
    BuildSystem-->>Developer: 빌드 결과 및 SwiftLint 피드백 제공
Loading

Assessment against linked issues

Objective Addressed Explanation
SwiftLint 파일을 추가합니다. (#20)
Tuist project에 Lint script 추가 (#20)
환경 변수 설정 (#20)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
.coderabbit.yaml 파일 신규 추가 (.coderabbit.yaml) SwiftLint 설정과 무관한 CodeRabbit 리뷰 및 도구 설정 파일로, 이슈 #20의 목표와 직접적인 관련이 없습니다.
test.md 파일 삭제 (test.md) SwiftLint 세팅과 무관한 테스트 관련 문서 삭제로, 이슈 #20의 범위에 포함되지 않습니다.

Possibly related PRs

  • chore: swiftlint & coderabbit 세팅 #21: 동일한 .coderabbit.yaml, SwiftLint 설정 파일, SwiftLint 스크립트 추가 및 프로젝트 타겟 수정이 포함되어 있어 직접적으로 관련된 PR입니다.

Poem

🐰
깡총깡총 토끼가 말해요,
SwiftLint로 코드가 반짝여요!
빌드할 때마다 깔끔한 줄,
규칙 따라 멋진 코드 출발!
lint 스크립트도 척척,
이제 우리 프로젝트는 더욱 쑥쑥!
🥕✨
"""


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 524becc and 2f454ff.

📒 Files selected for processing (1)
  • .coderabbit.yaml (1 hunks)
✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch BOOK-41-chore/#20
  • Post Copyable Unit Tests in Comment

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 auto-generate unit tests to generate unit tests for 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 or @coderabbitai 요약 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.

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

🧹 Nitpick comments (6)
src/Tuist/ProjectDescriptionHelpers/SwiftLintScript.swift (1)

4-6: 정의만 하고 사용되지 않는 상수 제거 필요

swiftLintConfigPath 는 선언 후 사용되지 않습니다. 빌드 경고를 방지하기 위해 삭제하거나 실제로 활용해 주세요.

-let projectDir = ProcessInfo.processInfo.environment["PROJECT_DIR"] ?? ""
-let swiftLintConfigPath = "\(projectDir)/../../.swiftlint.yml"
+// PROJECT_DIR 사용 시점이 생기면 다시 도입하세요.
src/Projects/Booket/Project.swift (1)

16-18: 앱 타깃에도 SwiftLint 활성화

앱 레벨에서도 일관된 코드스타일 검증이 가능해졌습니다. 다만 린트 시간이 길어질 경우 RUN_SCRIPT_INPUT_FILE_COUNT 등을 이용해 변경된 파일만 린트하도록 최적화할 수 있으니 추후 고려해 보세요.

src/.swiftlint.yml (4)

1-3: trailing_whitespace 룰 비활성화 검토
trailing_whitespace 룰을 비활성화하면 코드에 불필요한 공백이 남아 있을 수 있습니다. 특별한 이유가 없다면 활성화 유지가 권장됩니다.


14-14: 사용 전 identifier_name 룰 주석 정리 필요
identifier_name 룰 적용 전 확인이 필요한 주석이 남아 있습니다. 실제 사용 여부를 확정한 후 주석을 제거하거나 명확한 설명으로 업데이트하세요.


26-34: type_name.min_length error 임계값 조정 제안
현재 error: 1로 설정되어 실제로 에러가 발생하지 않습니다. 예측 가능한 에러 조건(예: error: 2)으로 조정하는 것을 권장합니다.


57-59: 불필요한 trailing whitespace 제거
59번째 줄 끝에 불필요한 공백이 있습니다. 해당 공백을 제거해주세요.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41ce0a8 and 524becc.

📒 Files selected for processing (12)
  • .coderabbit.yaml (1 hunks)
  • src/.swiftlint.yml (1 hunks)
  • src/Projects/BKCore/Project.swift (1 hunks)
  • src/Projects/BKData/Project.swift (1 hunks)
  • src/Projects/BKDesign/Project.swift (1 hunks)
  • src/Projects/BKDomain/Project.swift (1 hunks)
  • src/Projects/BKNetwork/Project.swift (1 hunks)
  • src/Projects/BKPresentation/Project.swift (1 hunks)
  • src/Projects/BKStorage/Project.swift (1 hunks)
  • src/Projects/Booket/Project.swift (1 hunks)
  • src/Tuist/ProjectDescriptionHelpers/SwiftLintScript.swift (1 hunks)
  • test.md (0 hunks)
💤 Files with no reviewable changes (1)
  • test.md
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/Projects/BKNetwork/Project.swift (1)
src/Tuist/ProjectDescriptionHelpers/TargetDependency+Module.swift (1)
  • core (5-7)
🪛 YAMLlint (1.37.1)
src/.swiftlint.yml

[error] 59-59: trailing spaces

(trailing-spaces)

🔇 Additional comments (9)
src/Projects/BKPresentation/Project.swift (1)

12-14: SwiftLint 스크립트 추가 확인 완료

메인 타깃에 swiftLintScript 가 정상적으로 포함되었습니다.
테스트 타깃에는 굳이 필요 없으므로 현재 구성으로 충분합니다.

src/Projects/BKData/Project.swift (1)

12-14: SwiftLint 스크립트 추가 확인 완료

데이터 모듈에도 동일하게 적용되었습니다.
일관성 유지 👍

src/Projects/BKStorage/Project.swift (1)

12-14: SwiftLint 스크립트 추가 확인 완료

스토리지 모듈도 동일하게 설정되어 있습니다.
특이사항 없습니다.

src/Projects/BKNetwork/Project.swift (2)

12-14: SwiftLint 스크립트 추가 👍

빌드 단계에 SwiftLint를 포함하여 정적 분석을 자동화한 점이 반갑습니다. 스크립트 정의만 제대로 노출돼 있다면(예: ProjectDescriptionHelpers/SwiftLintScript.swift), 별다른 문제 없이 동작할 것입니다.


15-17: 순환 참조 여부 재검증을 위해 BKCore의 Tuist 매니페스트에서 BKNetwork 참조를 검색합니다.

#!/bin/bash
# BKCore의 Project.swift에서 BKNetwork 참조 여부 확인
fd -t f "Project.swift" src/Projects -x grep -H "BKNetwork" {}
src/Projects/BKDomain/Project.swift (1)

12-14: SwiftLint 스크립트 통합 완료

도메인 모듈에도 동일하게 적용되었음을 확인했습니다. 공통 규칙 유지에 도움이 됩니다.

src/Projects/BKDesign/Project.swift (1)

13-15: SwiftLint 스크립트 추가 확인

리소스 모듈에도 적용되어 전체 모듈 커버리지가 확보되었습니다. 문제 없습니다.

src/Projects/BKCore/Project.swift (1)

12-14: BKCore에 린트 스크립트 적용

핵심 모듈부터 린트가 적용돼 코드 품질 확보에 도움이 됩니다. 테스트 타깃에는 제외되어 있으므로 필요 시 별도 적용을 검토하세요.

src/.swiftlint.yml (1)

60-66: 커스텀 ios17_uikit_api_usage 룰 설정 적절
iOS 17 이상 API 사용 검출을 위한 커스텀 룰이 잘 정의되어 있습니다.

Comment thread .coderabbit.yaml
Comment thread .coderabbit.yaml
Comment thread src/Tuist/ProjectDescriptionHelpers/SwiftLintScript.swift
@clxxrlove clxxrlove merged commit fc99b06 into develop Jun 17, 2025
@clxxrlove clxxrlove deleted the BOOK-41-chore/#20 branch June 17, 2025 08:18
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.

[BOOK-41/chore] SwiftLint 세팅

2 participants