banovo/coding-standard

Banovo PHP编码标准的CodeSniffer规则集

安装次数: 5,918

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 4

分支: 0

开放问题: 0

类型:phpcodesniffer-standard

0.8.1 2020-10-28 09:30 UTC

README

Build Status

安装

添加到composer.json

"require-dev": {
    "banovo/coding-standard": "0.3.*"
},
"scripts": {
    "post-install-cmd": [
        "echo 'bin/checker' > .git/hooks/pre-commit"
    ],
    "post-update-cmd": [
        "echo 'bin/checker' > .git/hooks/pre-commit"
    ]
},

添加预提交钩子

echo './vendor/bin/php-cs-fixer fix --config=./vendor/banovo/coding-standard/rulesets/.php_cs.dist src && git add .' > .git/hooks/pre-commit

使用方法

预提交钩子会在你运行git commit时自动执行检查器。

运行bin/checker -h查看更多配置选项。

更新

确保它是最新的