php git commit hooks

v1.0.0 2016-04-21 08:21 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:24:04 UTC


README

Total Downloads

依赖

composer require fp-coding-standards/fpcs

功能简述

1、在提交代码(git commit)到git库时,本钩子被触发。
2、调用phpcbf和phpcs,来做代码检查并尝试自动修复代码样式。
3、将修复后的代码提交到git库中。

安装步骤

1、安装依赖PHP_CodeSniffer,定义代码样式,本例中使用FunPlus-Coding-Standards
2、安装钩子 vendor/bin/git-hooks-install

参考

1. git钩子

参考 Git Hook 或自行Google

2.代码检查

本钩子使用PHP_CodeSniffer做代码检查,需要提前配置好PHP_CodeSniffer和PHP_CodeSniffer所需的rule set。