Skip to content

Commit

Permalink
feat: ensure commit message path is provided for commit linting
Browse files Browse the repository at this point in the history
  • Loading branch information
a145789 committed Apr 21, 2024
1 parent 8c34855 commit 0eca4a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix"
},
"packageManager": "pnpm@8.7.5",
"packageManager": "pnpm@9.0.1",
"engines": {
"node": ">=16.0.0",
"pnpm": ">=8.0"
Expand Down Expand Up @@ -76,4 +76,4 @@
"picocolors": "^1.0.0",
"semver": "^7.5.4"
}
}
}
5 changes: 5 additions & 0 deletions src/commitLint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export function commitLint(options: CommitLintCommandOptions) {
warningMessage = WARNING_MESSAGE,
} = options

if (!commitMessagePath) {
logger.error('commitMessagePath is required')
process.exit(1)
}

const commitMessage = getCommitMessage(commitMessagePath)
const isValidCommitMessage = new RegExp(commitMessageRe).test(commitMessage)

Expand Down

0 comments on commit 0eca4a1

Please sign in to comment.