Null Pointer Mayhem

    cz-karpo

    1.0.15 • Public • Published

    cz-karpo

    cz-karpo是根据cz-conventional-changelog制作的符合公司团队的中文定制化适配器,美化commit提交。

    安装

    #npm
    npm install commitizen cz-karpo --save-dev
    
    # 或者
    yarn add -D commitizen cz-karpo

    配置

    package.json

    与 commitizen 一样,您可以通过 package.jsonconfig.commitizen关键字来配置cz-karpo

    {
    // ...  default values
        "config": {
            "commitizen": {
                "path": "cz-karpo",// 如有问题可以设置此路径:./node_modules/cz-karpo
                "disableScopeLowerCase": false,
                "disableSubjectLowerCase": false,
                "maxHeaderWidth": 100,
                "maxLineWidth": 100,
                "defaultType": "",
                "defaultScope": "",
                "defaultSubject": "",
                "defaultBody": "",
                "defaultIssues": "",
                "types": {
                  ...
                  "feat": {
                    "description": "A new feature",
                    "title": "Features"
                  },
                  ...
                }
            }
        }
    // ...
    }
    

    环境变量

    以下环境变量可用于覆盖任何默认配置,包括 package.json的配置

    • CZ_TYPE = defaultType
    • CZ_SCOPE = defaultScope
    • CZ_SUBJECT = defaultSubject
    • CZ_BODY = defaultBody
    • CZ_MAX_HEADER_WIDTH = maxHeaderWidth
    • CZ_MAX_LINE_WIDTH = maxLineWidth

    Commitlint

    如果使用commitlint js 库, “maxHeaderWidth”配置属性将默认为“header-max-length”规则的配置,而不是硬编码的值 100。这可以通过在package.json中设置“maxHeaderWidth”配置来完成或 CZ_MAX_HEADER_WIDTH 环境变量。

    参考

    1. https://github1s.com/z649319834/cz-conventional-changelog-zh
    2. commitizen/cz-conventional-changelog: A commitizen adapter for the angular preset of https://github.com/conventional-changelog/conventional-changelog
    3. https://github.com/SignDigit1/cz-conventional-changelog-zh

    Install

    npm i cz-karpo

    DownloadsWeekly Downloads

    0

    Version

    1.0.15

    License

    MIT

    Unpacked Size

    17.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • duanledexian