定制 org_heigl/captainhook_addtime 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

org_heigl/captainhook_addtime

Composer 安装命令:

composer require org_heigl/captainhook_addtime

包简介

Add the time since your last commit to the commit-message

README 文档

README

A small addition to CaptainHook that will add the time since your last commit to your commitmessage

That way you can use a different tool to extract the times you spent on a project from the commitmessages

To be sure that the time is added to each commit there is also a check that can be used to verify that a time is added.

GitLab-CI Bild-Status Scrutinizer Code Quality

Installation

Install this package using composer

composer require --dev heiglandreas/captainhook_addtime

Usage

Adding time

In your captainhook.json file you can then add this hook to your prepare-commit-msg-hooks:

{
  "prepare-commit-msg" : {
    "enabled" : true,
    "actions" : [{
      "action" : "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\AddTimeAction",
      "options" : {
        "fuzziness": "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\Fuzzier\\TenMinutesCeiling"
      }
    }]
  }
}

This will round up to the next 10 minutes.

Verifying time is added

To make sure that each commit contains a time you can add this to your captainhook.json-file:

{
  "commit-msg": {
    "enabled": true,
    "actions": [{
      "action": "\\Org_Heigl\\CaptainHook\\Hooks\\AddTime\\EnsureTime",
      "options": {}
    }]
  }
}

This will require each commit-message to contain something like the following on one line:

Time: 12h15m

There can be whitespace before or after the content but the 'h' and 'm' needs to be lower case and there must not be any whitespace in that time-information.

You can ommit the hours or the minutes. (Ommiting both doesn't really make sense (-; )

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-12-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固