我已经安装并配置了预提交。运行pre-commit run
时,我得到以下信息,然后显示错误消息:
[INFO] Initializing environment for C:\Users\username\projectname.
[INFO] Installing environment for C:\Users\username\projectname.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: Command: ('C:\Users\username\.cache\pre-commit\repo1qx9mnkz\py_env-python3.7\Scripts\pip.exe', 'install', '.') ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
我正在使用anaconda bash从Windows运行它。我将git放在路径上,以便预先提交找到存储库。
我已经尝试从anaconda环境之外运行它,但是即使停用它并再次安装pre-commit,该错误仍然存在。
我也尝试过运行pre-commit clean
,它已经解决了先前的问题(起初找不到我的“ pre-commit-hooks.yaml”文件”),但是此错误仍然存在。