diff options
author | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:14:42 +0900 |
---|---|---|
committer | HyungKyu Song <hk76.song@samsung.com> | 2013-02-16 00:14:42 +0900 |
commit | 715f9ce62a12d128754d2cf47f90a024b537e320 (patch) | |
tree | 57fb94c81055a31938bea831641092152a03089f /common/gst-indent | |
parent | dfa84b358c7cdf0535eba1fead62fc4122cc56e6 (diff) | |
download | gst-plugins-good0.10-tizen_2.0.tar.gz gst-plugins-good0.10-tizen_2.0.tar.bz2 gst-plugins-good0.10-tizen_2.0.zip |
Diffstat (limited to 'common/gst-indent')
-rwxr-xr-x | common/gst-indent | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/common/gst-indent b/common/gst-indent new file mode 100755 index 0000000..732b2ba --- /dev/null +++ b/common/gst-indent @@ -0,0 +1,49 @@ +#!/bin/sh +# +# Check that the code follows a consistant code style +# + +# Check for existence of indent, and error out if not present. +# On some *bsd systems the binary seems to be called gnunindent, +# so check for that first. + +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 "GStreamer git pre-commit hook:" + 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_PARAMETERS="--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" + +$INDENT ${INDENT_PARAMETERS} $@ + |