我已经安装并配置了预提交。运行时,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 放在路径上,以便 pre-commit 找到 repo。我已经尝试从外部 anaconda 环境运行它,但即使停用它并再次安装预提交,错误仍然存在。我也尝试过运行pre-commit clean
,它已经解决了以前的问题(起初它找不到我的“pre-commit-hooks.yaml”文件”),但这个错误仍然存在。