pre-commit 과 pre-push hook 이 동작하기 위해 사전에
yarn
으로 husky 를 설치해야 한다.
yarn
./gradlew ktlintCheck
./gradlew ktlintFormat
파일 저장 시 자동 포맷팅 하려면 ktlint
플러그인 설치 후 아래처럼 설정
- Preferences -> Tools -> ktlint Settings
- Preferences -> Tools -> Actions on Save
요구사항: docker, docker-compose
docker-compose up
테스트 코드 실행 시 발생한 sql 을 보고싶은 경우
- server-app/src/test/resources/application.yml
spring:
jpa:
properties:
hibernate:
check_nullability: true
use_sql_comments: true
format_sql: true
show_sql: true # true 로 변경
logging:
level:
org:
hibernate:
type: trace # trace 로 변경
./gradlew :app:bootRun
git hook 이 제대로 설정된 상태라면 푸시하기 전에 아래 category 테스트가 자동으로 실행된다.
CategoryAppList.kt 파일이 수정된 경우 category 응답 데이터를 업데이트 해야한다. CategoryAppControllerTest 테스트를 실행하면 된다.
./gradlew clean
으로 다시 설치한다.