aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-07-20 10:29:46 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2017-07-22 14:25:01 -0700
commit590cb7c3de5664ad424a94d361be6db02f0329cd (patch)
tree0457c9502bc422b3cfc07666f56fb6a169744e38
parentfd1ebbafb01bb6a5d36b7ae1666c516715efd75f (diff)
test/ws_scan.sh: scanner for updating issue #102
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r--test/ws_scan.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ws_scan.sh b/test/ws_scan.sh
new file mode 100644
index 00000000..46b8a398
--- /dev/null
+++ b/test/ws_scan.sh
@@ -0,0 +1,11 @@
+#!bash
+
+# checks for mixed indentation and empty lines with whitespace
+# run from test/
+
+cd ..
+grep -lHIrP --include=*.{h,c} -- '^((\t+ +)|( +\t+)|\s+$)' | sed 's/^/- [ ] /' > test/hardinfo-bad.txt
+grep -LHIrP --include=*.{h,c} -- '^((\t+ +)|( +\t+)|\s+$)' | sed 's/^/- [x] /' > test/hardinfo-good.txt
+cat test/hardinfo-bad.txt test/hardinfo-good.txt | LC_ALL=C sort -k 1.5 | grep -vP " (test|build)"
+rm test/hardinfo-bad.txt test/hardinfo-good.txt
+cd test