Skip to content

Instantly share code, notes, and snippets.

Forked from ktoso/gist:708972
Created July 16, 2013 20:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# This hook will run the eclipse code formatter before any commit
# to make the source look as it's supposed to look like in the repo.
echo "Running pre-commit hook: run-eclipse-formatter---------------------"
echo "Will run eclipse formatter, using: $STYLE_FILE"
echo "Listing folders to run formatter on… "
code_dirs=`find . -maxdepth 3 | grep 'src/'`
for dir in $code_dirs; do
echo $dir;
echo "Launching eclipse code formatter… "
exec $ECLIPSE_HOME/eclipse \
-nosplash \
-application org.eclipse.jdt.core.JavaCodeFormatter \
-verbose \
-config $STYLE_FILE \
echo "done---------------------------------------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment