Reputation: 99
I want to run pylint for every new commit and amend in git. I am a beginner, don't know much about git.
Below are my questions:
Upvotes: 1
Views: 1684
Reputation: 1329642
I want to run
pylint
from a python file.
How can I get the list of files over there?
Using GitPython, you can easily list files in a given commit:
commit.stats.files
You can then apply pylint
, using the elements of that list.
Note: to do it without using GitPython, see "Get a list of changed files between two commits or branches": compare between <SHA1>
and <SHA1>~1
: your commit, and the parent (first ancestor) of your commit.
Upvotes: 1