Skip to content

Instantly share code, notes, and snippets.

@gkzhong
gkzhong / Checkstyle pre-commit hook
Created October 19, 2012 08:04 — forked from davetron5000/Checkstyle pre-commit hook
Pre Commit Hook for running checkstyle on changed files
#!/usr/bin/perl
#
# Pre-commit hook for running checkstyle on changed Java sources
#
# To use this you need:
# 1. checkstyle's jar file somewhere
# 2. a checkstyle XML check file somewhere
# 3. To configure git:
# * git config --add checkstyle.jar <location of jar>
# * git config --add checkstyle.checkfile <location of checkfile>