This repository was archived by the owner on Jun 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4242 "@types/babel__core" : " ^7.1.9" ,
4343 "@typescript-eslint/eslint-plugin" : " ^4.20.0" ,
4444 "@typescript-eslint/parser" : " ^4.20.0" ,
45+ "chalk" : " ^4.1.1" ,
4546 "eslint" : " ^7.23.0" ,
4647 "eslint-config-prettier" : " ^8.3.0" ,
4748 "eslint-plugin-prettier" : " ^3.4.0" ,
5758 },
5859 "husky" : {
5960 "hooks" : {
60- "commit-msg " : " commitlint -E $HUSKY_GIT_PARAMS " ,
61- "pre- commit" : " lint-staged "
61+ "pre-commit " : " lint-staged " ,
62+ "commit-msg " : " node scripts/verifyCommit.js "
6263 }
6364 },
6465 "lint-staged" : {
Original file line number Diff line number Diff line change 1+ // Invoked on the commit-msg git hook by yorkie.
2+
3+ const fs = require ( 'fs' )
4+ const chalk = require ( 'chalk' )
5+ const msgPath = process . env . HUSKY_GIT_PARAMS
6+ const msg = fs . readFileSync ( msgPath , 'utf-8' ) . trim ( )
7+
8+ const commitRE =
9+ / ^ ( r e v e r t : ) ? ( f e a t | f i x | d o c s | d x | s t y l e | r e f a c t o r | p e r f | t e s t | w o r k f l o w | b u i l d | c i | c h o r e | t y p e s | w i p | r e l e a s e ) ( \( .+ \) ) ? : .{ 1 , 50 } /
10+
11+ if ( ! commitRE . test ( msg ) ) {
12+ console . log ( )
13+ console . error (
14+ ` ${ chalk . bgRed . white ( ' ERROR ' ) } ${ chalk . red (
15+ `invalid commit message format.`
16+ ) } \n\n` +
17+ chalk . red (
18+ ` Proper commit message format is required for automated changelog generation. Examples:\n\n`
19+ ) +
20+ ` ${ chalk . green ( `feat(compiler): add 'comments' option` ) } \n` +
21+ ` ${ chalk . green (
22+ `fix(v-model): handle events on blur (close #28)`
23+ ) } \n\n` +
24+ chalk . red ( ` See .github/commit-convention.md for more details.\n` )
25+ )
26+ process . exit ( 1 )
27+ }
You can’t perform that action at this time.
0 commit comments