前言
刚好写Shell工程,需要规范代码提交,就简单记录下。╮(╯▽╰)╭
流程
安装插件
# 安装npm环境
brew install npm
# 安装插件
npm install -g @commitlint/cli @commitlint/config-conventional
- 如果对于commitlint有更多想要了解的,详见:helps your team adhering to a commit convention. By supporting npm-installed configurations it makes sharing of commit conventions easy.
# 安装后,如果项目下面没有package.json
[npm | cnpm] init -y
结果为:(提前将最终的配置结果贴出来,😁)
{
"name": "xxxx",
"version": "0.0.1",
"author": "notzonotdied",
"description": "xxxx",
"scripts": {
},
"license": "ISC",
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@commitlint/prompt": "^8.2.0",
"commitizen": "^4.0.3",
"conventional-changelog-cli": "^2.0.25",
"husky": "^4.0.0-beta.5"
},
"husky"