mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 22:01:27 +00:00
5f3d98f29f
It was previously broken, which is why we never needed it. This keeps backward compatibility with indent <= 2.2.11
40 lines
894 B
Bash
Executable file
40 lines
894 B
Bash
Executable file
#!/bin/sh
|
|
|
|
version=`gnuindent --version 2>/dev/null`
|
|
if test "x$version" = "x"; then
|
|
version=`indent --version 2>/dev/null`
|
|
if test "x$version" = "x"; then
|
|
echo "GStreamer git pre-commit hook:"
|
|
echo "Did not find GNU indent, please install it before continuing."
|
|
exit 1
|
|
fi
|
|
INDENT=indent
|
|
else
|
|
INDENT=gnuindent
|
|
fi
|
|
|
|
case `$INDENT --version` in
|
|
GNU*)
|
|
;;
|
|
default)
|
|
echo "Did not find GNU indent, please install it before continuing."
|
|
echo "(Found $INDENT, but it doesn't seem to be GNU indent)"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
$INDENT \
|
|
--braces-on-if-line \
|
|
--case-brace-indentation0 \
|
|
--case-indentation2 \
|
|
--braces-after-struct-decl-line \
|
|
--line-length80 \
|
|
--no-tabs \
|
|
--cuddle-else \
|
|
--dont-line-up-parentheses \
|
|
--continuation-indentation4 \
|
|
--honour-newlines \
|
|
--tab-size8 \
|
|
--indent-level2 \
|
|
--leave-preprocessor-space \
|
|
$*
|