【问题标题】:What would a git hook look like that checks the correct version of python was used?检查使用了正确版本的 python 的 git 钩子会是什么样子?
【发布时间】:2018-10-16 01:23:52
【问题描述】:

我一直试图找到一个 git 钩子的例子,它检查提交的文件是否是 python,以及它们是否是使用的 python 版本。

【问题讨论】:

    标签: git gitlab githooks pre-commit-hook


    【解决方案1】:

    你可以使用像 sebdah/git-pylint-commit-hook 这样的钩子,修改它以在 pylint 报告错误时退出(它将用于非 python 文件)

    但要检测写作风格,没有灵丹妙药:正如这里所说,您需要compile with python2 or python3(仍然处于困境中)。

    【讨论】:

      猜你喜欢
      • 2016-07-18
      • 1970-01-01
      • 2019-07-12
      • 2019-09-30
      • 1970-01-01
      • 2019-10-25
      • 1970-01-01
      • 2012-06-03
      相关资源
      最近更新 更多