当前位置: 首页 > 工具软件 > pre-commit > 使用案例 >

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

陆沈浪
2023-12-01

今天准备使用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/

 类似资料: