定制 nafigator/php-qa-hooks 二次开发

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

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

nafigator/php-qa-hooks

Composer 安装命令:

composer require nafigator/php-qa-hooks

包简介

Git hooks for PHP commits QA.

README 文档

README

GitHub license GitHub release Conventional Commits Semantic Versioning

PHP QA git hooks

Git hooks for PHP commits quality assurance

pre-commit output example

Requirements

  • git
  • bash
  • PHP CLI
  • Core utils

Features

  • Customization by git config options
  • Check for PHP syntax before commit
  • Check for Git conflict markups before commit
  • Warn about PHP dump functions (var_dump(), var_export(), print_r())
  • Check PHP code style before push
  • Run PHPUnit tests before push
  • Colored output

Install via Composer

  1. Install package:

     composer require --dev nafigator/php-qa-hooks
    
  2. Add extra section to composer.json:

     "extra": {
         "scripts-dev": {
             "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-install.sh"
         }
     }
    
  3. Place phpcs.xml into root of your project.

    NOTE: An example phpcs.xml file can be found in the PHP_CodeSniffer repository: phpcs.xml.dist

  4. Run composer install.

Uninstall

  1. Remove git config section check.php

     git config --remove-section check.php
    
  2. Add extra section to composer.json:

     "extra": {
         "scripts-dev": {
             "post-install-cmd": "vendor/nafigator/php-qa-hooks/src/hooks-uninstall.sh"
         }
     }
    

    Commit and push your changes to repository. When uninstall script completes cleanup for all work copies, move to next step.

  3. Remove package:

     composer remove --dev nafigator/php-qa-hooks
    
  4. Remove phpcs.xml from root ot your project.

Configuration

Example (colors off):

git config check.php.colors false

Available git config options:

check.php.colors [true|false]
check.php.conflicts [true|false]
check.php.dumps [true|false]
check.php.phpunit [true|false]
check.php.style [true|false]
check.php.syntax [true|false]

NOTE: PHPUnit disabled by default. You need to enable it manually.

Versioning

This software follows "Semantic Versioning" specifications. All function signatures declared as public API.

Read more on SemVer.org.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 1
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固