Giter VIP home page Giter VIP logo

Comments (2)

zhanghuabin avatar zhanghuabin commented on June 12, 2024

能大致说说第3点的思路么?

我先说一下我的需求:

有点类似于如下.commitlintrc.json这个配置文件的目的——指定每个项目特有的规则。

{
    "extends": [
        "@commitlint/config-conventional"
    ],
    "rules": {
        "scope-enum": [
            2,
            "always",
            [
                "rest",
                "service",
                "shared",
                "tests",
                "db",
                "redis",
                "cicd",
                "devops",
                "docker",
                "build",
                "conf",
                "javadoc",
                "doc"
            ]
        ]
    }
}

from plugins.

henry-hub avatar henry-hub commented on June 12, 2024

能大致说说第3点的思路么?

我先说一下我的需求:

有点类似于如下.commitlintrc.json这个配置文件的目的——指定每个项目特有的规则。

{
    "extends": [
        "@commitlint/config-conventional"
    ],
    "rules": {
        "scope-enum": [
            2,
            "always",
            [
                "rest",
                "service",
                "shared",
                "tests",
                "db",
                "redis",
                "cicd",
                "devops",
                "docker",
                "build",
                "conf",
                "javadoc",
                "doc"
            ]
        ]
    }
}
  • 支持添加自定义type及相关scopefooterType,根据这些配置信息会在项目下自动生成conventionalcommit.json配置,用于导入Conventional Commit插件
  • 另外footerType支持是否必填校验配置,比如:Reviewer
  • 后续也可以支持一些自定义正则,比如某种注脚需要什么样的格式

目前的conventionalcommit.json默认配置如下:

{
  "types": {
    "refactor": {
      "description": "Changes which neither fix a bug nor add a feature"
    },
    "fix": {
      "description": "Changes which patch a bug"
    },
    "feat": {
      "description": "Changes which introduce a new feature"
    },
    "build": {
      "description": "Changes which affect the build system or external dependencies.<br/>Example scopes: gulp, broccoli, npm",
      "scopes": {
        "npm": {},
        "gulp": {},
        "broccoli": {}
      }
    },
    "chore": {
      "description": "Changes which aren't user-facing"
    },
    "style": {
      "description": "Changes which don't affect code logic, such as white-spaces, formatting, missing semi-colons"
    },
    "test": {
      "description": "Changes which add missing tests or correct existing tests"
    },
    "docs": {
      "description": "Changes which affect documentation"
    },
    "perf": {
      "description": "Changes which improve performance"
    },
    "ci": {
      "description": "Changes which affect CI configuration files and scripts.<br/>Example scopes: travis, circle, browser-stack, sauce-labs"
    },
    "revert": {
      "description": "Changes which revert a previous commit"
    }
  },
  "footerTypes": [
    {
      "name": "BREAKING CHANGE",
      "description": "The commit introduces breaking API changes"
    },
    {
      "name": "Closes",
      "description": "The commit closes issues or pull requests"
    },
    {
      "name": "Implements",
      "description": "The commit implements features"
    },
    {
      "name": "Co-authored-by",
      "description": "The commit is co-authored by another person.<br/>For multiple people use one line each"
    },
    {
      "name": "Refs",
      "description": "The commit references other commits by their hash ID.<br/>For multiple hash IDs use a comma as separator"
    }
  ]
}

from plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.