承接 rugaard/git-hooks 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rugaard/git-hooks

Composer 安装命令:

composer require rugaard/git-hooks

包简介

Composer plugin for handling Git hooks.

README 文档

README

This is a Composer plugin, which installs an application, that manages and handles everything related to git hooks in your project.

📖 Table of contents

🌟 Features

🐘 Git hooks in PHP

Web developers is not necessarily experts when it comes to shell scripting. With Git Hooks, this is no longer an issue. You can now write your plugins in PHP and can utilize all it's features.

🗂 Split scripts into separate files

If you wanted a git hook to perform serveral things, you would normally have to put it all into a single file. This increases the risk of errors, bloats the file, etc. By using this application, you can write and register each script individually. This makes it easier to read, understand and not to mention debug.

🪄 Auto registering

The application will automatically locate git hooks from compatible packages and automatically register and enable them. This means you don't have to configure anything. You install the package with your desired git hooks and that's it.

📤 Share your Git hooks

The purpose of this application is to separate and "modularize" the git hooks. Fx. you could create a package, with your most used git hooks from your projects and share it in a community or with your colleagues.

📦 Installation

You install the package via Composer by using the following command:

composer require rugaard/git-hooks

⚙️ Usage

Whenever you're performing git actions, the application will automatically run and execute the appropriate scripts to the triggered git hooks. There is no manual involvement required.

However, it is possible to create a custom configuration file, where you can disable scripts and overwrite/append arguments, if the script supports it.

📝 Custom configuration

To create a custom configuration, you need to run the following command, in the root of your project:

./vendor/bin/git-hooks config

This creates a git-hooks.config.json file, which contains a few options: register, disable and parameters.

Register scripts

You can create and register your own project specific scripts, by adding it to the register array in the custom configuration file:

{
  "register": [
    "Namespace\\GitHooks\\PreCommit\\ForceIssueNumberCommand"
  ],
  "disable": [],
  "parameters": {}
}

Disable scripts

You might find a git-hook collection with multiple scripts, but you are not interested in using all of them at once. Instead of skipping the entire collection or create your own collection, you can instead disable the scripts you don't want to use.

To disable a script, simply add it to disable array in the custom configuration file:

{
  "register": [],
  "disable": [
    "Namespace\\GitHooks\\PreCommit\\ValidateMessageCommand"
  ],
  "parameters": {}
}

Script parameters

It's possible to overwrite or append arguments to specific scripts, if these scripts supports it. This gives some form of flexibility when installing a git-hook collection from a 3rd party.

An example could be, that you wanted to change the "printer" that the installed PHPUnit script uses:

{
  "register": [],
  "disable": [],
  "parameters": {
    "Namespace\\GitHooks\\PrePush\\PhpTestSuiteCommand": {
      "driver": "phpunit",
      "config": "tests/phpunit.xml"
    }
  }
}

🧩 List registered scripts

To get an overview of which scripts are registered with the application, you can run the following command:

./vendor/bin/git-hooks registered

This command also lists the namespaces of each script, which is needed if you're using a custom configuration file.

🧑🏻‍💻 Create your own Git hook

Follow the guide in the projects Wiki.

🚓 License

This package is licensed under MIT.

rugaard/git-hooks 适用场景与选型建议

rugaard/git-hooks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 103 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 05 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「plugin」 「git」 「composer」 「hooks」 「composer plugin」 「git hooks」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 rugaard/git-hooks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 rugaard/git-hooks 我们能提供哪些服务?
定制开发 / 二次开发

基于 rugaard/git-hooks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-05-25