Get static code analyzer messages only from 'git diff'?

In our build system (with sources under git version control), I’d like to get the static code analyzer (pylint, in this case) messages for every build. And I want them incremental: in the new build report, only the messages introduced by new commits are shown.

I can easily get the ‘old’ and ‘new’ commits. Then, the general path is to run the analyzer on the ‘new’ commit, and then, for each source code line with a message, find whether that line is new/modified, or if it is intact from the ‘old’ commit. Then, print only messages from new/modified lines.

  • Git and multiple repositories
  • GitHub - Find the pull request associated with a commit
  • Will 'git push origin <branch>' remove <branch> remotely after removing it locally?
  • How do I acquire a “cleansed” Git repository?
  • How to get the current checked out Git branch name through pygit2?
  • git list all available commands
  • Is there a simpler way of achieving this goal for pylint? Or is there an existing implementation of something similar?

  • git-merge-base returns only one commit
  • Maintaining directory structure during Android Studio import
  • What is the right .gitconfig syntax for http.sslCAInfo certificate for specific server?
  • Git error: “fatal: .. does not appear to be a git repository” - when deploying via Capistrano
  • How to get the current/active branch with LibGit2Sharp?
  • msysgit git-am can't apply it's own git format-patch sequence
  • One Solution collect form web for “Get static code analyzer messages only from 'git diff'?”

    You can get list of files changed between commits and pass it to pylint then. With github pullrequest workflow it looks like this:

    git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD master) | grep .py | xargs pylint
    
    Git Baby is a git and github fan, let's start git clone.