use checkstyle implement incremental check.
with the implement, we can use checkstyle only check the new code in every pull request
main code is clone from https://github.com/centic9/jgit-cookbook
- git workflow(use jgit)
git merge-base xxx xxx //get common commit.
git rev-parse HEAD //get current commit
git diff --unified=0 commit1 commit2 //get diff - parse diff
- update suppressions.xml
- combine with checkstyleMain task
please see code in DiffFilesInCommit.java and build.gradle