From 6e5ee35085dc84a128e77018c85a7aa45be7d860 Mon Sep 17 00:00:00 2001 From: mpl Date: Mon, 25 Feb 2013 19:28:06 +0100 Subject: [PATCH] precommit: check trailing space in java sources too Change-Id: I85820763b6c1075f5c8ff5d793b082bd11181931 --- misc/pre-commit.githook | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/pre-commit.githook b/misc/pre-commit.githook index c0fe8f0f4..30750f5ae 100755 --- a/misc/pre-commit.githook +++ b/misc/pre-commit.githook @@ -21,6 +21,7 @@ committed=`git diff-index --cached --name-only HEAD` for c in $committed do gofile=`echo $c | grep -E '.*\.go$'` + javafile=`echo $c | grep -E '.*\.java$'` if [ -n "$gofile" ] then fmtdiff=`gofmt -d $c 2>&1` @@ -29,6 +30,9 @@ do echo "gofmt needed on "$c exitstatus=1 fi + fi + if [ -n "$gofile" -o -n "$javafile" ] + then trailspace=`git diff-index --cached --check HEAD $c | grep 'trailing whitespace'` if [ -n "$trailspace" ] then