Skip to content

husky 설정#33

Merged
yoouyeon merged 5 commits intodevelopfrom
chore/MD-32
Apr 16, 2026
Merged

husky 설정#33
yoouyeon merged 5 commits intodevelopfrom
chore/MD-32

Conversation

@yoouyeon
Copy link
Copy Markdown
Contributor

@yoouyeon yoouyeon commented Apr 15, 2026

💻 작업 내용

prettier 오류로 고생하시는 여은님을 위해.... 🥹
lint, prettier 체크 자동화를 위해 husky를 설정했습니다.
그리고 의존성 업데이트되었을 때마다 신경써서 설치하는게 좀 번거로울 것 같아서 ... 브랜치를 이동했을 때 의존성이 변경되었다면 yarn install을 실행하는 훅도 추가했어요!!

추가한 훅 :

pre-commit

커밋 직전에 staged 파일을 대상으로 prettier 자동 수정 -> eslint 검사를 순서대로 실행합니다.

post-checkout

브랜치 전환 시에 yarn.lock 파일을 확인하고 변경된 경우 yarn install을 자동으로 실행합니다.

참고 : https://teamblog.joonggonara.co.kr/웹개발팀-모노레포-2-husky-설정-2f7503d999a0

📸 스크린샷

pre-commit: eslint 오류 있는 파일 커밋 시 차단 확인 pre-commit: prettier 오류 있는 파일 커밋 시 자동 수정 후 커밋 확인
Screen_Shot 2026-04-15 16 36 33
Screen_Shot.2026-04-15.16.41.48.mov
post-checkout: yarn.lock이 다른 브랜치로 전환 시 yarn install 자동 실행 확인
Screen_Shot 2026-04-15 17 27 40

Summary by CodeRabbit

  • 새로운 기능

    • 커밋 전 자동 포매팅 및 린팅 실행(린트스테이지 연동)
    • 의존성 잠금파일 변경 시 자동 의존성 설치(체크 후 실행)
    • Husky 훅 자동 설정을 위한 준비 스크립트 추가
  • 개선사항

    • 코드 포매터 설정과 검사/수정 스크립트 추가로 개발자 워크플로우 개선
    • 특정 자산 디렉터리를 포매팅 대상에서 제외하여 포매팅 처리 최적화

- pre-commit: staged 파일에 prettier --write, eslint 순으로 실행
- post-checkout: yarn.lock 변경 시 yarn install 자동 실행
@yoouyeon yoouyeon self-assigned this Apr 15, 2026
@yoouyeon yoouyeon added the 🧹 Chore 설정·잡무 작업 label Apr 15, 2026
@github-actions github-actions Bot requested a review from ongheong April 15, 2026 08:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

📝 관련 이슈

MD-32

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b11022f-cd28-4bb8-b7b6-b60dc3cbe69c

📥 Commits

Reviewing files that changed from the base of the PR and between 127dd17 and 839b198.

📒 Files selected for processing (2)
  • .github/workflows/prod-ci-cd.yml
  • .husky/post-checkout
✅ Files skipped from review due to trivial changes (1)
  • .husky/post-checkout
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/prod-ci-cd.yml

📝 Walkthrough

Walkthrough

CI 환경에서 Husky를 비활성화하는 환경변수 추가, Husky 훅 두 개(pre-commit, post-checkout) 및 lint-staged·Prettier 관련 스크립·설정과 의존성을 추가했습니다. .prettierignore에 경로가 추가되었습니다.

Changes

Cohort / File(s) Summary
깃 훅
.husky/pre-commit, .husky/post-checkout
pre-commit 훅에서 npx lint-staged 실행; post-checkout 훅은 브랜치 체크아웃 여부 확인 후 yarn.lock 변경 시 yarn install 실행.
패키지 설정 및 포맷팅 스크립
package.json
prettier:check, prettier:fix, prepare 스크립트 추가; lint-staged 설정 추가; husky·lint-staged devDependencies 추가; test 스크립트 소폭 서식 변경.
포맷터 제외 목록
.prettierignore
src/shared/assets 디렉터리를 Prettier 포맷팅 대상에서 제외하도록 항목 추가.
CI/CD 워크플로우
.github/workflows/prod-ci-cd.yml
의존성 설치 단계에서 envHUSKY: 0을 정의해 Husky를 설치 시 비활성화하도록 변경.

Poem

🐇 깃 훅을 품은 토끼가 말하네,
커밋 전엔 lint로 다듬고,
브랜치 바뀌면 lock을 살피네,
포맷은 깔끔히, 설치는 조용히,
코드 숲에 봄바람이 불었구나 🌱✨

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/MD-32

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.

@yoouyeon yoouyeon changed the title Chore/md 32 husky 설정 Apr 15, 2026
yoouyeon added a commit that referenced this pull request Apr 15, 2026
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.husky/post-checkout:
- Around line 1-3: The hook currently relies on reflog via HEAD@{1}; update the
git diff invocation to use the post-checkout hook parameters by replacing
HEAD@{1} and HEAD with the provided variables "$1" and "$2" (and quote them),
e.g. use git diff --name-only "$1" "$2" | grep -q 'yarn.lock'; keep the echo and
yarn install behavior unchanged and consider using "$3" if you need to
branch-checkout-specific logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6a7e144a-bb65-4578-b446-65c665c6f3ce

📥 Commits

Reviewing files that changed from the base of the PR and between 2d230b0 and 127dd17.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/prod-ci-cd.yml
  • .husky/post-checkout
  • .husky/pre-commit
  • .prettierignore
  • package.json

Comment thread .husky/post-checkout Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 15, 2026

Deploying moddo-frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: 839b198
Status:🚫  Build failed.

View logs

- reflog 의존성 제거 ($1, $2 사용)
- 브랜치 체크아웃이 아닌 경우 스킵 ($3 체크 추가)

ref:
#33 (comment)
@yoouyeon
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 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.

@yoouyeon
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 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
Contributor

@ongheong ongheong left a comment

Choose a reason for hiding this comment

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

프리티어 설정이 자꾸 사라져서 곤란했는데 이렇게 husky로 커밋 전에 검사할 수 있게 적용해주셔서 감사해요!!!🥹
다음 작업부터 바로 사용해보겠습니다🥰

@yoouyeon yoouyeon merged commit 3853b7d into develop Apr 16, 2026
1 of 2 checks passed
@yoouyeon yoouyeon deleted the chore/MD-32 branch April 16, 2026 12:14
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.

2 participants