|
| 1 | +# 브랜치명 검증 가이드 |
| 2 | + |
| 3 | +**실행 시점**: `git push` 시 (푸시 전) |
| 4 | +**스크립트**: `.husky/validate-branch.cjs` |
| 5 | +**형식**: `<type>/<description>` 또는 `<type>/<domain>/<description>` |
| 6 | +**허용 문자**: 소문자(a-z), 숫자(0-9), 하이픈(-), 점(.), 언더바(_) |
| 7 | + |
| 8 | +## 허용 타입 |
| 9 | + |
| 10 | +| 타입 | 설명 | 예시 | |
| 11 | +|--------------|----------------------|----------------------------------| |
| 12 | +| `feature` | 새로운 기능 개발 | `feature/user-authentication` | |
| 13 | +| `fix` | 버그 수정 | `fix/login-bug` | |
| 14 | +| `hotfix` | 긴급 버그 수정 | `hotfix/critical-security-issue` | |
| 15 | +| `release` | 릴리스 준비 | `release/v1.0.0` | |
| 16 | +| `refactor` | 코드 리팩토링 | `refactor/auth-logic` | |
| 17 | +| `docs` | 문서 업데이트 | `docs/installation-guide` | |
| 18 | +| `test` | 테스트 추가 | `test/unit-tests` | |
| 19 | +| `chore` | 유지보수 작업 | `chore/update-deps` | |
| 20 | +| `style` | 스타일 개선 | `style/format-code` | |
| 21 | +| `copilot` | GitHub Copilot 지원 개발 | `copilot/add-validation` | |
| 22 | +| `claude` | Claude AI 지원 개발 | `claude/refactor-api` | |
| 23 | +| `dependabot` | 의존성 업데이트 | `dependabot/npm_and_yarn` | |
| 24 | + |
| 25 | +## 보호 브랜치 (직접 푸시 허용) |
| 26 | + |
| 27 | +`main`, `master`, `develop`, `staging` |
| 28 | + |
| 29 | +## 브랜치명 형식 |
| 30 | + |
| 31 | +### 2단계 형식 (기본) |
| 32 | + |
| 33 | +```bash |
| 34 | +✅ feature/user-authentication |
| 35 | +✅ fix/404-error |
| 36 | +✅ copilot/add-validation |
| 37 | +✅ claude/refactor-api |
| 38 | +✅ hotfix/security-patch-2024 |
| 39 | +✅ release/1.0.0 |
| 40 | +``` |
| 41 | + |
| 42 | +### 3단계 형식 (도메인 포함) |
| 43 | + |
| 44 | +```bash |
| 45 | +✅ feature/frontend/user-authentication |
| 46 | +✅ fix/api/null-response |
| 47 | +✅ refactor/backend/auth-logic |
| 48 | +✅ docs/api/endpoint-guide |
| 49 | +✅ test/integration/payment-flow |
| 50 | +✅ dependabot/npm_and_yarn/turbo-2.7.3 |
| 51 | +``` |
| 52 | + |
| 53 | +### ❌ 잘못된 형식 |
| 54 | + |
| 55 | +```bash |
| 56 | +Feature/Frontend/User-auth # 대문자 사용 금지 |
| 57 | +my-feature # 타입 누락 |
| 58 | +feature/a/b/c # 4단계 이상 금지 |
| 59 | +feature/ # 설명 누락 |
| 60 | +``` |
| 61 | + |
| 62 | +## 작명 규칙 |
| 63 | + |
| 64 | +1. **소문자만 사용**: `Feature` ❌ → `feature` ✅ |
| 65 | +2. **명확한 설명**: `fix/bug` ❌ → `fix/login-validation-error` ✅ |
| 66 | +3. **하이픈으로 단어 구분**: `userauth` ❌ → `user-authentication` ✅ |
| 67 | +4. **간결하게**: `feature/add-new-user-authentication-system-for-web` ❌ |
| 68 | + → `feature/user-authentication` ✅ |
| 69 | + |
| 70 | +## 검증 우회 |
| 71 | + |
| 72 | +```bash |
| 73 | +# 긴급 상황에서만 사용 |
| 74 | +git push --no-verify |
| 75 | +``` |
| 76 | + |
| 77 | +⚠️ **주의**: GitHub Actions에서는 우회할 수 없으므로 규칙을 준수하세요. |
| 78 | + |
| 79 | +## 다중 검증 계층 |
| 80 | + |
| 81 | +| 계층 | 시점 | 우회 가능 여부 | |
| 82 | +|----------------|-----------------|----------------------------| |
| 83 | +| 로컬 Husky | `git push` 실행 시 | ✅ `--no-verify` 플래그로 우회 가능 | |
| 84 | +| GitHub Actions | PR 생성/수정 시 | ❌ 필수 체크 (우회 불가) | |
| 85 | + |
| 86 | +GitHub Actions 검증은 `.github/workflows/branch-name-check.yml`에서 실행됩니다. |
0 commit comments