关于git:一款vscode-git规范化提交的插件

0次阅读

共计 2075 个字符,预计需要花费 6 分钟才能阅读完成。

vscode git 规范化提交插件,欢送 star!

git-commit-lint-vscode

在日常的开发中, 目前支流的代码管理工具就是 git 了, 当咱们对代码进行改变了, 首先得 git commit 提交到本地仓库,git 规定了提交时必须填写提交信息作为改变阐明, 保留 commit 历史中, 能够找到历史代码, 也不便别人 review, 还能够输入 CHANGELOG, 对我的项目的研发品质都有很大的晋升。

然而在平时的工作中, 大部分对于 commit 都是简略的填写, 没有好好的器重, 这对于项目管理和保护来说, 无疑是不敌对的。这个插件就是规范化git 提交标准, 让你的提交不仅 ” 难看 ” 还 ” 实用 ”

git 标准提交从何说起?

git 标准提交从哪里开始的呢? 起源在哪呢?emmmmmm, 这就追溯到了 Angular 了!
让咱们看下 Angular 社区的提交标准

这个提交记录是不是高深莫测? 所以 git commit 标准下还是很有必要的!

阐明

类型 emji 形容
feat 引入新性能
fix 🐛 修复 bug
style 💄 更新 UI 款式文按键
format 🥚 格式化代码
docs 📝 增加 / 更新文档
perf 👌 进步性能 / 优化
init 🎉 首次提交 / 初始化我的项目
test 减少测试代码
refactor 🎨 改良代码构造 / 代码格局
patch 🚑 增加重要补丁
file 📦 增加新文件
publish 🚀 公布新版本
tag 📌 公布新版本
config 🔧 批改配置文件
git 🙈 增加或批改.gitignore 文件

应用成果

应用阐明

  • 1
  • 2

下载

在 vscode 扩大中搜寻 git-commit-lint-vscode 即可找到该插件。

插件配置

你能够在 vscode 的 文件 -> 首选项 -> 设置 -> 扩大 -> git-commit-lint-vscode 中对该插件进行配置,目前可选的配置项为:

  1. Accurate Locating: 当存在多个存储库时,是否精确定位到选定存储库的输入框,默认为 。注:该性能在少数状况下能够失常运行,只有当你的源代码治理存储库存在多个存储库,如只抉择局部存储库或程序谬误时,就会选中谬误的输入框。
  2. Cover Input Value: 是否笼罩提交信息, 默认为 。如果勾销勾选,则会在之前的提交信息前插入 emoji 或者 code。
  3. Custom Format: 自定义 git 提交格局, 默认为 ${emoji}${code}: 。能够齐全自定义 参数取Custom Type 外面的key
  4. Custom Type: 自定义 git 提交类型, 默认为
[
  {
    "emoji": "✨",
    "type": "feat",
    "name": "引入新性能",
    "description": "新性能"
  },
  {
    "emoji": "🐛",
    "type": "fix",
    "name": "修复 bug",
    "description": "bug"
  },
  {
    "emoji": "💄",
    "type": "style",
    "name": "更新 UI 款式文件",
    "description": "款式"
  },
  {
    "emoji": "🥚",
    "type": "format",
    "name": "格式化代码",
    "description": "格式化"
  },
  {
    "emoji": "📝",
    "type": "docs",
    "name": "增加 / 更新文档",
    "description": "文档"
  },
  {
    "emoji": "👌",
    "type": "perf",
    "name": "进步性能 / 优化",
    "description": "优化"
  },
  {
    "emoji": "🎉",
    "type": "init",
    "name": "首次提交 / 初始化我的项目",
    "description": "初始化"
  },
  {
    "emoji": "✅",
    "type": "test",
    "name": "减少测试代码",
    "description": "测试"
  },
  {
    "emoji": "🎨",
    "type": "refactor",
    "name": "改良代码构造 / 代码格局",
    "description": "优化"
  },
  {
    "emoji": "🚑",
    "type": "patch",
    "name": "增加重要补丁",
    "description": "补丁"
  },
  {
    "emoji": "📦",
    "type": "file",
    "name": "增加新文件",
    "description": "新文件"
  },
  {
    "emoji": "🚀",
    "type": "publish",
    "name": "公布新版本",
    "description": "新版本"
  },
  {
    "emoji": "📌",
    "type": "tag",
    "name": "公布版本 / 增加标签",
    "description": "书签"
  },
  {
    "emoji": "🔧",
    "type": "config",
    "name": "批改配置文件",
    "description": "配置"
  },
  {
    "emoji": "🙈",
    "type": "git",
    "name": "增加或批改.gitignore 文件",
    "description": "不可见"
  }
]

issues

应用中能够在这发问, 有什么需要同样能够在这提出来

https://github.com/UvDream/git-commit-lint-vscode/issues

正文完
 0