summaryrefslogtreecommitdiff
path: root/devtools/reindent
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-04-04 18:44:48 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-04-04 18:44:48 -0400
commita5e56a43541dbb1e5f9f8bd9e6ba6494935a7210 (patch)
tree85536f16dbf3f54cced278c0b4f4a6c059db40ff /devtools/reindent
parent59ecba222046a860b0a34f314886659996fb03f3 (diff)
downloadgpsd-a5e56a43541dbb1e5f9f8bd9e6ba6494935a7210.tar.gz
The failed attempt at reindenting should be kept for the record.
Diffstat (limited to 'devtools/reindent')
-rwxr-xr-xdevtools/reindent26
1 files changed, 26 insertions, 0 deletions
diff --git a/devtools/reindent b/devtools/reindent
new file mode 100755
index 00000000..3e364f4e
--- /dev/null
+++ b/devtools/reindent
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Re-indent the codebase in a uniform style for readability.
+#
+# This is more or less a failed experiment, kept for the record.
+
+INDENT_OPTIONS = --indent-level4 \
+ --honour-newlines \
+ --dont-break-procedure-type \
+ --cuddle-else \
+ --braces-on-if-line \
+ --case-brace-indentation0 \
+ --brace-indent0 \
+ --no-space-after-casts \
+ --no-space-after-function-call-names \
+ --start-left-side-of-comments \
+ --dont-format-comments
+indent:
+ chmod u+w *maskdump.c
+ indent $(INDENT_OPTIONS) *.c
+ for f in *.c; \
+ do \
+ sed <$${f} >/tmp/reindent$$$$ -e 's/@ \*/@*/' ; \
+ mv /tmp/reindent$$$$ $${f} ; \
+ done
+ chmod u-w *maskdump.c
+ @echo "Diff lines:" `git diff | wc -l`