jonathadv / commitlint-as-a-service

use commitlint as a http service

Home Page:https://commitlint-as-a-service.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

use commitlint as a http service

https://commitlint-as-a-service.herokuapp.com/

License:MIT License


Languages

Language:JavaScript 77.2%Language:HTML 22.8%