type
status
date
slug
summary
tags
category
icon
password
URL
这里写文章的前言:
一个简单的开头,简述这篇文章讨论的问题、目标、人物、背景是什么?并简述你给出的答案。
可以说说你的故事:阻碍、努力、结果成果,意外与转折。
📝 主旨内容
Dear Interweb,
I've stumbled upon `pre-commit`, a tool, or rather framework to manage your pre-commit Git hooks. When you've been submitting Pull Request to Python-based repositories long enough, you'll find some of these projects prefers to use `pre-commit` to do various linting tasks, besides using `tox`. My quick test with `pre-commit` showed that it was faster compares to doing the same linting task using `tox`, and have more hooks available which were rather difficult or cumbersome to set up through `tox`. For example, validating TOML config file.
However, there was an issue when I tried to set it up in my local development machine, I kept getting the above titled error message when I tried to install it for my local Python pet projects:
Even following the hint given, I was still facing the same error:
Based on the collective wisdom of SO, the issue was caused by existing global Git hooks. Check if you've one configured already. We shouldn't have any value for the `core.hooksPath` config item as shown below:
If you've already configured `core.hooksPath`, remove it using the command below:
And we should be able to use `pre-commit` to install Git hooks for our Git repository, as shown below:
Till the next post.
Yours truly,
Ang
🤗 总结归纳
总结文章的内容
📎 参考文章
- 引用文章
有关Notion安装或者使用上的问题,欢迎您在底部评论区留言,一起交流~
- 作者:NotionNext
- 链接:https://tangly1024.com/article/69c8d28b-4a3b-4948-bc90-f99f92bbccf8
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。