0
点赞
收藏
分享

微信扫一扫

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


今天准备使用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 条评论