douglasmariz/pre-commit-git

该软件包最新版本(dev-master)没有可用的许可信息。

GIT 预提交钩子,用于在提交前检查代码中是否存在某些单词、短语或函数(如dump、var_dump、die、print_r等)。

dev-master 2015-06-10 13:59 UTC

This package is not auto-updated.

Last update: 2024-10-02 08:56:57 UTC


README

GIT - 预提交检查特定单词

关于

GIT 预提交钩子,用于检查要提交的代码中是否存在某些单词、短语或函数。

如何安装

要安装钩子,将 pre-commit 文件复制到您的项目 .git/hooks/pre-commit

$ cp pre-commit .git/hooks/pre-commit; $ chmod +x .git/hooks/pre-commit; $ cp commit.msg .git/hooks/commit.msg; $ chmod + x .git/hooks/commit.msg;

该钩子包含作为检查字符串的 "die"、"print_r" 和 "var_dump" 函数。您可以通过修改 checks 数组添加更多要检查的字符串。