summaryrefslogtreecommitdiff
path: root/tools/check-c-style.sh
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-21 13:43:13 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-07-21 13:43:13 +0000
commit97cd9d4072ff82006388c4843f87bd24d157ccfa (patch)
tree2aa7e018204b4dda2d809f6b04994fb2ea8fb68d /tools/check-c-style.sh
parent01ae2edd6aba118ac701ee0d27742424fef7ac07 (diff)
downloadtelepathy-glib-97cd9d4072ff82006388c4843f87bd24d157ccfa.tar.gz
Tighten coding style checking
20080721134313-53eee-6fc655da0dc9b0b97ec6ec2fcb73876bb8a2c38c.gz
Diffstat (limited to 'tools/check-c-style.sh')
-rw-r--r--tools/check-c-style.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/check-c-style.sh b/tools/check-c-style.sh
index 357fdb365..dd62fb7ba 100644
--- a/tools/check-c-style.sh
+++ b/tools/check-c-style.sh
@@ -24,6 +24,26 @@ then
fail=1
fi
+if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then
+ echo "^^^ Our coding style is to have a space between a cast and the "
+ echo " thing being cast"
+ fail=1
+fi
+
+# this only spots casts
+if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then
+ echo "^^^ Our coding style is to have a space before the * of pointer types"
+ echo " (regex 1)"
+ fail=1
+fi
+# ... and this only spots variable declarations and function return types
+if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \
+ "$@"; then
+ echo "^^^ Our coding style is to have a space before the * of pointer types"
+ echo " (regex 2)"
+ fail=1
+fi
+
if test -n "$CHECK_FOR_LONG_LINES"
then
if egrep -n '.{80,}' "$@"