#! /bin/sh
#  pre-commit -- hooks for SANE backends
#  Copyright (C) 2017  Olaf Meeuwissen
#
#  License: GPL-3.0+

git diff --name-only --cached | xargs -r tools/style-check.sh
if test $? -ne 0 ; then
    cat <<EOF >&2
Run

  git diff --name-only --cached | xargs tools/style-check.sh --fix

to address most, if not all, of the reported issues.
EOF
    exit 1
fi
