Skip to content

jonathadv/commitlint-as-a-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

commitlint-as-a-service

Use commitlint with @commitlint/config-conventional rules as a http service.

Project setup

npm install

Run server

$ node app

or

$ nodemon app

Call with JSON Response

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"
}

Call with Text Response

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: testtype 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

Releases

No releases published

Packages

No packages published