为git存储库强制执行常规git提交消息

enforce-git-message的Python项目详细描述


pypipythonimplementation

licenselast-commit

donatefollow

强制git消息

project logo

对通过运行git init创建的所有新git存储库强制执行conventional git commit messages。对于现有的存储库,您可以转到源目录并简单地运行:< > >

enforce-git-message

有效的提交消息示例:

+ 61c8ca9 fix: navbar not responsive on mobile+ 479c48b test: prepared test cases for user authentication+ a992020 chore: moved to semantic versioning+ b818120 fix: button click even handler firing twice+ c6e9a97 fix: login page css+ dfdc715 feat(auth): added social login using twitter

导致错误消息的无效提交消息示例:

- 61c8ca9 fix for navbar not responsive on mobile- 479c48b prepared test cases for user authentication- a992020 moved to semantic versioning- b818120 fixed button click even handler firing twice- c6e9a97 login page css fix- dfdc715 added social login auth feature using twitter

安装

pip install enforce-git-message

验证

转到您的源文件夹并尝试使用这样的非常规消息提交,它应该会失败:

> git commit -m "added a new feature for xyz"

COMMIT FAILED!

Please enter commit message in the conventional format and try to commit again. Examples:

+ 61c8ca9 fix: navbar not responsive on mobile
+ 479c48b test: prepared test cases for user authentication
+ a992020 chore: moved to semantic versioning
+ b818120 fix: button click even handler firing twice
+ c6e9a97 fix: login page css
+ dfdc715 feat(auth): added social login using twitter

之后,尝试使用有效的消息执行提交,它应该可以工作:

> git commit -m "feat(test): added xyz"
>

注释

Read this article通过使用git钩子完全理解强制的实际工作方式。

归因

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法启动发现(Android附近连接API v2)   如何用Java在Firestore中创建嵌套字段?   GUI Java中的swing BMI计算器;   java如何检查上下文是否为当前正在运行的活动   LiveCycle ES4支持java 8吗?   构建Spring引导API后,java类路径不正确   启动时swing Java Jtable行颜色   JAVAutil。ConcurrentModificationException随着Apache Tomee Plus 7.1.2的发布启动ear文件   在JAVA中使用lambda表达式的foreach for循环   java小程序没有在我的IE8和firefox6中运行。0.2   java有没有比ConcurrentHashMap性能更好的并发映射?   java Android静态与非静态问题   尝试提交TableCell时调用java cancelEdit()   java在LINUX系统上使用MCRTsim模拟器   Java多态性方法重写