From c31a907ccd0e996e7651be3f082dbcf0ea3c4758 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Mon, 29 Oct 2012 20:59:19 +0100 Subject: [PATCH 1/3] A small tool that shows the diff between the original file and the file produced by running it through contiki-indent --- tools/check-contiki-style | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 tools/check-contiki-style diff --git a/tools/check-contiki-style b/tools/check-contiki-style new file mode 100755 index 000000000..c0ce2928a --- /dev/null +++ b/tools/check-contiki-style @@ -0,0 +1,8 @@ +#!/bin/sh +mkdir /tmp/$$ +cp $1 /tmp/$$/ +cp $1 /tmp/$$/$1.orig +export INDENT_PROFILE=`dirname $0`/indent.pro +indent /tmp/$$/$1 +diff /tmp/$$/$1.orig /tmp/$$/$1 +rm -rf /tmp/$$ From 9131c4183b551004f9c299d1aab9b6a311b63d8e Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Mon, 29 Oct 2012 20:59:32 +0100 Subject: [PATCH 2/3] Allow contiki-indent to operate on multiple files at once --- tools/contiki-indent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/contiki-indent b/tools/contiki-indent index 3a26bfa2f..9bcd36a14 100755 --- a/tools/contiki-indent +++ b/tools/contiki-indent @@ -1,3 +1,3 @@ #!/bin/sh export INDENT_PROFILE=`dirname $0`/indent.pro -indent $1 +indent $* From f6f9df802cc33f335f6e68bb302d1d87a08db5e9 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 20 Nov 2012 20:11:01 +0100 Subject: [PATCH 3/3] Updated script per suggestion by @g-oikonomou to allow script to operate on files in subdirectories --- tools/check-contiki-style | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/check-contiki-style b/tools/check-contiki-style index c0ce2928a..17096267c 100755 --- a/tools/check-contiki-style +++ b/tools/check-contiki-style @@ -1,8 +1,9 @@ #!/bin/sh +f=`basename $1` mkdir /tmp/$$ cp $1 /tmp/$$/ -cp $1 /tmp/$$/$1.orig +cp $1 /tmp/$$/$f.orig export INDENT_PROFILE=`dirname $0`/indent.pro -indent /tmp/$$/$1 -diff /tmp/$$/$1.orig /tmp/$$/$1 +indent /tmp/$$/$f +diff /tmp/$$/$f.orig /tmp/$$/$f rm -rf /tmp/$$