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