Integrate pylint with github review comments

Viewed 594

I am trying to make a script that runs pylint on the files present in the pull request and creates inline comments for the linting errors.

I got a hang on how to use PyGithub. The problem is that in order to comment on a pull-request you will have to know the commit that modified the file and the line number from the patch. Full documentation on the review comments API is found here.

Pylint returns the line in the resulted file. I need to get from foo/bar.py:30 to the commit that modified line 30 in foo/bar.py and to get the actual position in the diff for that file.

Is there something that already can do this or do I have to manually search for @@ lines in every commit involved in a pull request?

1 Answers
Related