aboutsummaryrefslogtreecommitdiff
path: root/test/check-spacing-style.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/check-spacing-style.sh')
-rw-r--r--test/check-spacing-style.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/check-spacing-style.sh b/test/check-spacing-style.sh
new file mode 100644
index 00000000..b8c1cd2a
--- /dev/null
+++ b/test/check-spacing-style.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+top_srcdir=${SOURCE_ROOT:-..}
+. ${top_srcdir}/test/setup_env.sh
+
+ebegin "Checking spacing style"
+out=$(cd ${top_srcdir}; find src -name '*.[ch]' \
+ ! -name queue.h \
+ -exec grep -n -E \
+ -e '\<(for|if|switch|while)\(' \
+ -e '\<(for|if|switch|while) \( ' \
+ -e ' ;' \
+ -e '[[:space:]]$' \
+ -e '\){' \
+ -e '(^|[^:])//' \
+ {} +)
+[ -z "${out}" ]
+eend $? "These lines violate style rules:"$'\n'"${out}"