【问题标题】:Visual Studio Code: could not find an installed version of pre-commitVisual Studio Code:找不到预提交的已安装版本
【发布时间】:2021-02-21 13:13:31
【问题描述】:

我需要在我的项目上运行预提交测试,因此我下载并安装了以下 VSCode 扩展:https://marketplace.visualstudio.com/items?itemName=MarkLarah.pre-commit-vscode

它只是说“在 VSCode 命令栏中键入预提交运行”,这在选择测试后给了我以下错误: Could not find an installed version of pre-commit

谁能给点建议?

【问题讨论】:

    标签: visual-studio-code pre-commit


    【解决方案1】:

    扩展名pre-commit-vscode 目前在以下路径中查找pre-commit

        venv/bin/pre-commit
        virtualenv_run/bin/pre-commit
        virtualenv/bin/pre-commit
    

    参考:https://github.com/magicmark/pre-commit-vscode/blob/68b0f656d23520e6639a270c8d024da81b7cd509/src/index.js#L40

    所以只要我们可以在这些路径中安装二进制文件,它就可以工作。

    作者有一个TODO 显然是为了在 $PATH 中查找二进制文件。在此之前,您必须使用上述解决方法。

    【讨论】:

      猜你喜欢
      • 2019-05-14
      • 2021-03-07
      • 2022-11-13
      • 1970-01-01
      • 1970-01-01
      • 2015-07-10
      • 2019-06-14
      • 1970-01-01
      相关资源
      最近更新 更多