Git: pre-receive hook with PHP_CodeSniffer

后端 未结 10 1611
情话喂你
情话喂你 2021-02-04 07:51

Since switching from SVN to Git, we lost the ability to enforce our coding standards through a pre-commit hook on the subversion server.

With Git, you only

10条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 08:36

    I would rather not wait for a server-side hook to control a push.

    You could setup an intermediate repo which would fetch each developer's branches very regularly and audit each new commit, sending an email if a commit fails to meet some pre-defined criteria.

    You can also have pre-receive hook on the central repo, but at least the developer would be aware of a potential issue sooner.

提交回复
热议问题