Skip to content

[CHORE #29]: spotless 적용 - #30

Merged
seoyeon2001 merged 11 commits into
developfrom
chore/#29
Feb 25, 2026
Merged

[CHORE #29]: spotless 적용#30
seoyeon2001 merged 11 commits into
developfrom
chore/#29

Conversation

@seoyeon2001

@seoyeon2001 seoyeon2001 commented Feb 23, 2026

Copy link
Copy Markdown
Collaborator

📌 개요

프로젝트 코드 스타일을 통일하고, 리뷰/AI 가이드 품질을 높이기 위해 Spotless를 적용했습니다.

🔧 작업 내용

  1. 코드 포맷터 적용 (Spotless)
  • Spotless 적용
    • 포맷 스타일: palantirJavaFormat 사용
    • removeUnusedImports, trimTrailingWhitespace, endWithNewline 적용
  1. Push 시 포맷 체크 추가
  • push 전에 spotlessCheck 수행
  • 포맷이 맞지 않으면 push가 실패합니다.
    • 실패 시 로컬에서 ./gradlew spotlessApply 실행 후 다시 push 해주세요.
  1. CI에서 포맷/테스트 검증 강화
  • CI에서 spotlessCheck + test 수행하도록 반영 (포맷 미적용/테스트 실패 시 CI 실패)
  1. 테스트 환경 개선 (인메모리 DB)
  • 테스트 DB를 인메모리(H2) 기반으로 변경하여 CI 환경에서도 동작하도록 수정
  1. 실패 테스트 수정
  • UserAndRefreshTokenJpaTest 테스트 1건 수정
  1. CI/CD 워크플로우 개선
  • PR에서는 CD(배포) 수행하지 않도록 분리/조건 추가
    • develop 브랜치에 반영(push/merge)될 때만 배포되도록 구성
  • CI 단계에서 테스트도 함께 수행되도록 반영
    • 테스트는 인메모리 DB 기준으로 동작

✅ 체크리스트

  • 로컬 테스트 완료 (./gradlew clean test)

📝 기타 참고 사항

  1. Git hooks 설치 안내
  • 이 PR merge 후 pull 받은 다음, 아래 작업을 실행해주세요.
    ./gradlew updateGitHooks
  • push 시 포맷 체크가 자동으로 수행됩니다.
  • 포맷 미적용 시 push가 실패하니, 아래 명령으로 포맷 적용 후 다시 시도해주세요.
    ./gradlew spotlessApply
  1. 테스트 수정 상세
  • UserAndRefreshTokenJpaTest.java
    • deleteRefreshToken_byUserIdentifier 테스트 수정
    • 변경 전: assertThat(refreshTokenRepository.findByHashedRefreshToken("hashed-del-1")).isNull();
    • 변경 후: assertThat(refreshTokenRepository.findByHashedRefreshToken("hashed-del-1")).isEmpty();
  • 사유: Repository 메서드 반환 타입이 Optional이므로 null이 아닌 Optional.empty()가 반환됨

📎 관련 이슈

Close #29

@seoyeon2001 seoyeon2001 self-assigned this Feb 23, 2026
@seoyeon2001 seoyeon2001 added the 🧹 Chore 서비스에 직접적으로 영향을 주지 않는 프로젝트 기타 업무입니다. label Feb 23, 2026
@seoyeon2001 seoyeon2001 linked an issue Feb 23, 2026 that may be closed by this pull request

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

The pull request focuses on applying Spotless for code formatting, enhancing CI/CD workflows, and improving test environments. The changes introduce Spotless configuration, a pre-push Git hook for format checking, and modify several Java files to adhere to the new formatting rules. Additionally, the test database is switched to an in-memory H2 database, and one test case is adjusted to reflect Optional.empty() instead of null for repository method returns. Overall, the changes aim to standardize code style and improve development practices.

Comment thread build.gradle
Comment thread build.gradle
Comment thread build.gradle
Comment thread src/test/java/com/payper/server/UserAndRefreshTokenJpaTest.java

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

이 PR은 Spotless를 도입하여 일관된 코드 스타일을 적용하고, 테스트 환경을 인메모리 H2 데이터베이스로 전환하여 CI 환경에 더 적합하도록 개선했습니다. 코드 품질과 유지보수성을 높이는 좋은 변경입니다. 또한, pre-push git hook을 추가하여 개발자들이 푸시 전에 포맷을 확인할 수 있도록 한 점도 훌륭합니다. 전반적으로 변경 사항이 잘 구성되어 있으며, 테스트 코드 수정도 올바르게 이루어졌습니다. pre-push 스크립트를 더 견고하게 만들기 위한 작은 제안 사항이 하나 있습니다.

Comment thread scripts/pre-push

@Answl Answl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

수고했어요~~ 거의 다 포맷 맞추느라 변경된 코드네요!

@seoyeon2001
seoyeon2001 merged commit 3bf50d4 into develop Feb 25, 2026
2 checks passed
@seoyeon2001
seoyeon2001 deleted the chore/#29 branch February 25, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 Chore 서비스에 직접적으로 영향을 주지 않는 프로젝트 기타 업무입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: spotless 적용

2 participants