changeset 1679:90fffce0ee99

Add linter for #ifdef
author Matt Johnston <matt@ucc.asn.au>
date Sun, 24 May 2020 13:15:24 +0800
parents 4b4cfc92c5b7
children 5e763ad6e2e0
files Makefile.in dropbear_lint.sh release.sh
diffstat 3 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Thu May 21 23:00:22 2020 +0800
+++ b/Makefile.in	Sun May 24 13:15:24 2020 +0800
@@ -236,7 +236,7 @@
 $(STATIC_LTM): $(OPTION_HEADERS)
 	$(MAKE) -C libtommath
 
-.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean
+.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean lint
 
 ltc-clean:
 	$(MAKE) -C libtomcrypt clean
@@ -262,6 +262,9 @@
 tidy:
 	-rm -f *~ *.gcov */*~
 
+lint:
+	cd $(srcdir); ./dropbear_lint.sh
+
 ## Fuzzing targets
 
 # list of fuzz targets
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dropbear_lint.sh	Sun May 24 13:15:24 2020 +0800
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+EXITCODE=0
+
+# #ifdef instead of #if
+grep '#ifdef DROPBEAR' -I *.c *.h && EXITCODE=1
+
+exit $EXITCODE
--- a/release.sh	Thu May 21 23:00:22 2020 +0800
+++ b/release.sh	Sun May 24 13:15:24 2020 +0800
@@ -30,6 +30,7 @@
 hg archive "$RELDIR"  || exit 2
 
 (cd "$RELDIR" && autoconf && autoheader) || exit 2
+(cd "$RELDIR" && make lint) || exit 2
 
 rm -r "$RELDIR/autom4te.cache" || exit 2