mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
workflow: commitlint move to a simple script
This commit is contained in:
parent
397be94e79
commit
c12853c1a6
@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ["@commitlint/config-conventional"]
|
||||
};
|
@ -1 +1 @@
|
||||
# npx --no-install commitlint -e
|
||||
node scripts/verify-commit.js
|
@ -55,8 +55,6 @@
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17.0.2",
|
||||
"@commitlint/config-conventional": "^17.0.2",
|
||||
"@tsconfig/node22": "22.0.0",
|
||||
"@types/color": "^3.0.3",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
@ -69,12 +67,12 @@
|
||||
"@vue/eslint-config-prettier": "10.1.0",
|
||||
"@vue/eslint-config-typescript": "14.1.3",
|
||||
"@vue/tsconfig": "0.6.0",
|
||||
"commitlint": "^17.0.2",
|
||||
"eslint": "9.15.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-vue": "9.31.0",
|
||||
"husky": "9.1.7",
|
||||
"npm-run-all2": "7.0.1",
|
||||
"picocolors": "1.1.1",
|
||||
"plop": "4.0.1",
|
||||
"prettier": "3.3.3",
|
||||
"sass-embedded": "1.81.0",
|
||||
|
959
pnpm-lock.yaml
generated
959
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
22
scripts/verify-commit.js
Normal file
22
scripts/verify-commit.js
Normal file
@ -0,0 +1,22 @@
|
||||
// @ts-check
|
||||
import pico from 'picocolors'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
const msgPath = path.resolve('.git/COMMIT_EDITMSG')
|
||||
const msg = readFileSync(msgPath, 'utf-8').trim()
|
||||
|
||||
const commitRE =
|
||||
/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\(.+\))?: .{1,50}/
|
||||
|
||||
if (!commitRE.test(msg)) {
|
||||
console.log()
|
||||
console.error(
|
||||
` ${pico.white(pico.bgRed(' ERROR '))} ${pico.red(`invalid commit message format.`)}\n\n` +
|
||||
pico.red(` Proper commit message format is required for automated changelog generation. Examples:\n\n`) +
|
||||
` ${pico.green(`feat(compiler): add 'comments' option`)}\n` +
|
||||
` ${pico.green(`fix(v-model): handle events on blur (close #28)`)}\n\n` +
|
||||
pico.red(` See .github/commit-convention.md for more details.\n`)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user