在我的 pre-commit-config.yaml 文件中,我试图运行黑色,python 代码格式化程序
repos:
- repo: https://github.com/python/black
rev: stable
hooks:
- id: black
language_version: python3.6
但是每当我尝试使用代码运行黑色时pipenv run pre-commit --all
,都会失败并显示错误消息
An unexpected error has occurred: AttributeError: type object 'Hook' has no attribute 'create'
Check the log at some_path
当我去那里时,some_path
我找不到任何日志。我尝试不运行pipenv run pre-commit --all
将黑色应用到我的代码,但是当我尝试git commit
任何新文件时仍然会出现错误。有什么办法可以解决这个问题?