2024-04-20 06:50:21 发布
网友
我想为git中的每个新提交和修改运行pylint。我是个初学者,对git不太了解。你知道吗
以下是我的问题:
I want to run pylint from a python file. How can I get the list of files over there?
pylint
使用GitPython,您可以轻松地list files in a given commit:
commit.stats.files
然后可以使用该列表的元素应用pylint。你知道吗
注意:要在不使用GitPython的情况下执行此操作,请参见“Get a list of changed files between two commits or branches”:比较<SHA1>和<SHA1>~1:您的提交,以及提交的父级(第一个祖先)。你知道吗
<SHA1>
<SHA1>~1
使用GitPython,您可以轻松地list files in a given commit:
然后可以使用该列表的元素应用
pylint
。你知道吗注意:要在不使用GitPython的情况下执行此操作,请参见“Get a list of changed files between two commits or branches”:比较
<SHA1>
和<SHA1>~1
:您的提交,以及提交的父级(第一个祖先)。你知道吗相关问题 更多 >
编程相关推荐