Use commitlint with @commitlint/config-conventional rules as a http service.
npm install
$ node app
or
$ nodemon app
GET /?msg=<commit message>
$ curl -G http://localhost:3333/json --data-urlencode "msg=feat: test" | jq
{
"valid": true,
"errors": [],
"warnings": [],
"input": "feat: test"
}
$ curl -G http://localhost:3333/json --data-urlencode "msg=FeaT: test" | jq
{
"valid": false,
"errors": [
{
"level": 2,
"valid": false,
"name": "type-case",
"message": "type must be lower-case"
},
{
"level": 2,
"valid": false,
"name": "type-enum",
"message": "type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]"
}
],
"warnings": [],
"input": "FeaT: test"
}
GET /txt?msg=<commit message>
$ curl -G http://localhost:3333/text --data-urlencode "msg=feat: test"
ok
$ curl -G http://localhost:3333/text --data-urlencode "msg=FeaT: test"
⧗ input: FeaT: test
✖ type must be lower-case [type-case]
✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]
✖ found 2 problems, 0 warnings