承接 aequasi/git-hook-handler 相关项目开发

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

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

aequasi/git-hook-handler

最新稳定版本:2.1.2

Composer 安装命令:

composer require aequasi/git-hook-handler

包简介

Git Hook Handler

README 文档

README

Usage

Just create a git-hooks.yml file in your projects base directory, and fill it with an array of commands you want to run:

# git-hook.yml
config:
    commit-on-error : true # or false
pre-commit:
    # Simple command
    - bin/phpcs
    # or more complex command
    - phpunit:
        description : 'Run PHPUnit'
        command : phpunit
        exitcode : 0
    phpcs-fixer:
        description : 'Checking PHP Syntax with PHP-CS-FIXER'
        exitcode : 0
        command : >4
            COMMIT_RANGE='HEAD~..HEAD' &&
            CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}") &&
            if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then IFS=$'\n' EXTRA_ARGS=('--path-mode=intersection' '--' ${CHANGED_FILES[@]}); fi
            && ./vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no "${EXTRA_ARGS[@]}"

post-merge:
    command_name:
        description : 'lorem ipsum'
        command : 'mycommand'
        exitcode : 0

and then place the following in your composer.json, then run composer install or composer update

# composer.json
    "scripts": {
        "pre-update-cmd":  "Aequasi\\HookHandler\\HookScript::install",
        "pre-install-cmd": "Aequasi\\HookHandler\\HookScript::install"
    }

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2015-06-11