# Process each file
function check() {
+ oid=$3
id=$4
mode=$(echo $5 | cut -c1)
@@ -96,6 +97,25 @@ function check() {
echo $nfile >> $REP/.files.added
fi
+ # For Ada file, check change status, we normalize the old and new version
+ # of the unit and check the diff. No diff means that the changes are only
+ # reformatting and/or style fixes.
+
+ if [[ ! -z $(which normalize) ]]; then
+ file_ext=${bfile##*.}
+ if [[ "$file_ext" == "adb" || "$file_ext" == "ads" ]]; then
+ git show $oid > $REP/ofile
+ normalize $REP/ofile > $REP/n_ofile
+ normalize $REP/$bfile > $REP/n_nfile
+ diff -q $REP/n_ofile $REP/n_nfile > /dev/null
+ if [ $? = 0 ]; then
+ echo "$nfile: has no semantic changes (style changes only)"
+ fi
+ fi
+ fi
+
+ # style checker
+
( cd $REP; style_checker $SC_OPTS -n "$nfile" "$bfile"; )
res=$(($res + $?))
rm -f $REP/$bfile