步骤概括

  • 【下载phpcbf】到本地目录(下载地址见文档底部) > 例如: > Linux: ~/.composer/vendor/bin/phpcbf > Windows: c:\space\soft\system\phpcbf.phar
  • 【创建hooks】或修改hooks文件:.git/hooks/pre-commit
  • 【复制下方脚本】到pre-commit
  • 【修改路径】代码中phpcbf和php

Windows环境注意:

当提示

hint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.

是因为钩子文件没有运行权限,根据情况赋予钩子文件执行权限即可,例如:

chmod 700 .git/hooks/pre-commit

电脑端非常需要二维码识别,每次遇到二维码都需要找手机解锁,再唤起 app 来识别,实在麻烦。

其实,用截图工具(比如微信的)就能简单的植入一个二维码识别工具。哪怕初期只能打开个网页什么的呢。