承接 smgladkovskiy/phpcs-git-pre-commit 相关项目开发

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

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

smgladkovskiy/phpcs-git-pre-commit

Composer 安装命令:

composer require smgladkovskiy/phpcs-git-pre-commit

包简介

PHPCS check before commit

README 文档

README

About

Auto installed git pre-commit hook for running PHP Code Sniffer code checking to PSR2 coding standard compliance. It checks only files that are to be committed.

Inspired by Enforce code standards with composer, git hooks, and phpcs

Installation

Install smgladkovskiy/phpcs-git-pre-commit with composer require command:

composer require --dev "smgladkovskiy/phpcs-git-pre-commit"

Or alternatively, include a dependency for smgladkovskiy/phpcs-git-pre-commit in your composer.json file manually:

{
    "require-dev": {
        "smgladkovskiy/phpcs-git-pre-commit": "dev-master"
    }
}

To enable code sniff, аdd to post-install-cmd and post-update-cmd in composer.json installation script:

"scripts": {
    "install-hooks": ["sh ./vendor/smgladkovskiy/phpcs-git-pre-commit/src/setup.sh"],
    "post-install-cmd": ["@install-hooks"],
    "post-update-cmd": ["@install-hooks"]
}

Then run composer install or composer update. pre-commit hook will be installed or updated if it already exists.

Usage

Run git commit and pre-commit hook will check your committed files like if you run

php phpcs.phar --standard=PSR2 --encoding=utf-8 -n -p /path/to/file.php

Contributing

Feel free to make pull requests!

统计信息

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

GitHub 信息

  • Stars: 39
  • Watchers: 2
  • Forks: 34
  • 开发语言: Shell

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-14