|
1 | 1 | #!/usr/bin/env node |
2 | 2 |
|
3 | | -// Enforce branch naming: <developer-name>/AA-0000[anything] |
| 3 | +// Enforce branch naming: <developer-name>/PROJECT-NNN[anything] |
4 | 4 | // - developer-name: lowercase letters, numbers, dot, underscore, hyphen (one or more) |
5 | | -// - ticket: exactly 2 uppercase letters, hyphen, exactly 4 digits (e.g., PD-0000) |
| 5 | +// - ticket: one or more uppercase letters, hyphen, one or more digits (e.g., PD-0000, ENGAGE-243) |
6 | 6 | // - suffix: any optional characters after the ticket (e.g., "/feature-x", "-refactor", etc.) |
7 | 7 | // Special allowed names: transifex |
8 | 8 | // Examples: |
9 | 9 | // yourname/PD-0000 |
| 10 | +// lmendoza/ENGAGE-243 |
10 | 11 | // yourname/PD-0000-my-feature |
11 | 12 | // your.name/AB-0123/quick-fix |
12 | 13 |
|
@@ -67,15 +68,16 @@ function main() { |
67 | 68 | process.exit(0) |
68 | 69 | } |
69 | 70 |
|
70 | | - // developer-name / AA-0000 [anything] |
71 | | - const pattern = /^[a-z0-9._-]+\/[A-Z]{2}-\d{4}.*$/ |
| 71 | + // developer-name / PROJECT-NNN [anything] (e.g. PD-0000, ENGAGE-243) |
| 72 | + const pattern = /^[a-z0-9._-]+\/[A-Z]+-\d+.*$/ |
72 | 73 |
|
73 | 74 | if (!pattern.test(branch)) { |
74 | 75 | console.error( |
75 | | - '\u001b[31mBranch name must follow "<developer-name>/AA-0000[anything]" or be a special allowed name (e.g., "transifex").\u001b[0m' |
| 76 | + '\u001b[31mBranch name must follow "<developer-name>/PROJECT-NNN[anything]" or be a special allowed name (e.g., "transifex").\u001b[0m' |
76 | 77 | ) |
77 | 78 | console.error('\nExamples:') |
78 | 79 | console.error(' yourname/PD-0000') |
| 80 | + console.error(' lmendoza/ENGAGE-243') |
79 | 81 | console.error(' yourname/PD-0000-my-feature') |
80 | 82 | console.error(' your.name/AB-0123/quick-fix') |
81 | 83 | console.error(' transifex') |
|
0 commit comments