pre-commit报错误`.pre-commit-config.yaml is not a file`

kiliwalk

关注

阅读 166

2022-10-03


今天准备使用p re-commit 来优化代码,然后提交代码的时候发现了错误,我的运行命令为:

pre-commit install
pre-commit run --all-files

An error has occurred: InvalidConfigError: 
=====> .pre-commit-config.yaml is not a file
Check the log at /root/.cache/pre-commit/pre-commit.log

or

No .pre-commit-config.yaml file was found
- To temporarily silence this, run `PRE_COMMIT_ALLOW_NO_CONFIG=1 git ...`
- To permanently silence this, install pre-commit with the --allow-missing-config option
- To uninstall pre-commit run `pre-commit uninstall`

解决方法

pre-commit sample-config > .pre-commit-config.yaml

参考文献

​​https://madewithml.com/courses/mlops/pre-commit/​​


精彩评论(0)

0 0 举报