diff options
| author | Shinigami <[email protected]> | 2022-12-26 12:26:53 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-26 12:26:53 +0100 |
| commit | 2f613cff444eebae35e49fde0e8ba301c48f7a3e (patch) | |
| tree | 89080a52af4949018c8a3379db0dc41c5eb22e09 /scripts/verifyCommit.ts | |
| parent | f0d2ffb256e5aefb98d4f38905ef081c8e6af43e (diff) | |
| download | faker-2f613cff444eebae35e49fde0e8ba301c48f7a3e.tar.xz faker-2f613cff444eebae35e49fde0e8ba301c48f7a3e.zip | |
infra: remove git commit hooks (#1684)
Diffstat (limited to 'scripts/verifyCommit.ts')
| -rw-r--r-- | scripts/verifyCommit.ts | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/scripts/verifyCommit.ts b/scripts/verifyCommit.ts deleted file mode 100644 index 611c3a35..00000000 --- a/scripts/verifyCommit.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable @typescript-eslint/restrict-plus-operands */ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ - -// Invoked on the commit-msg git hook by simple-git-hooks. - -import { readFileSync } from 'fs'; -import colors from 'picocolors'; - -// get $1 from commit-msg script -const msgPath = process.argv[2]; -const msg = readFileSync(msgPath, 'utf-8').trim(); - -const releaseRE = /^v\d/; -const commitRE = - /^(feat|fix|chore|refactor|docs|test|ci|build|infra|revert|)(\(.+\))?\!?: .{1,50}/; - -const isMergeCommit = msg.startsWith('Merge remote-tracking-branch'); - -if (!isMergeCommit && !releaseRE.test(msg) && !commitRE.test(msg)) { - console.log(); - - console.error( - ` ${colors.bgRed(colors.white(' ERROR '))} ${colors.red( - `invalid commit message format.` - )} - - ${colors.red( - `Proper commit message format is required for automated changelog generation. Examples:` - )} - - ${colors.green(`feat: add 'comments' option`)} - ${colors.green(`fix: handle events on blur (close #28)`)} - - ${colors.red(`See .github/commit-convention.md for more details.`)} -` - ); - - process.exit(1); -} |
