]> granicus.if.org Git - postgis/commitdiff
Add check-no-trailing-blanks Makefile rule and run on `make check`
authorSandro Santilli <strk@kbt.io>
Thu, 14 Sep 2017 15:57:04 +0000 (15:57 +0000)
committerSandro Santilli <strk@kbt.io>
Thu, 14 Sep 2017 15:57:04 +0000 (15:57 +0000)
Only checks .h and .c files, and skip those in .gitignore

git-svn-id: http://svn.osgeo.org/postgis/trunk@15732 b70326c6-7e19-0410-871a-916f4a2858ee

GNUmakefile.in

index 1029b219b97ffa867764a7c2fd6a0d85414eb960..010b0aad055f151a17ddf2433345017e5ec9dbaa 100644 (file)
@@ -1,6 +1,6 @@
 #-----------------------------------------------------
 #
-# Configuration directives are in postgis_config.h 
+# Configuration directives are in postgis_config.h
 #
 #-----------------------------------------------------
 
@@ -35,7 +35,12 @@ clean-local:
 # TODO: drop 'test' target..
 test: check
 
-check: all docs-check
+check: all docs-check check-no-trailing-blanks
+
+check-no-trailing-blanks:
+       ! find . -name '*.cpp' -o -name '*.h' | \
+               grep -vf .gitignore | \
+               xargs grep -Pn '[\t ]$$'
 
 installcheck:
        RUNTESTFLAGS="$(RUNTESTFLAGS) --extension" $(MAKE) check
@@ -45,7 +50,7 @@ distclean: distclean-local
 distclean-local: clean-local
        rm -Rf autom4te.cache
        rm -f GNUmakefile
-       rm -f config.log config.cache config.status 
+       rm -f config.log config.cache config.status
        rm -f postgis_config.h
 
 maintainer-clean-local: distclean-local
@@ -53,7 +58,7 @@ maintainer-clean-local: distclean-local
        rm -f config.guess config.rpath config.sub
        rm -f libtool install-sh ltmain.sh
 
-maintainer-clean: 
+maintainer-clean:
        @echo '------------------------------------------------------'
        @echo 'This command is intended for maintainers to use; it'
        @echo 'deletes files that may need special tools to rebuild.'
@@ -85,7 +90,7 @@ templategis-install:
 templategis-uninstall:
        $(MAKE) -C extras/template_gis uninstall
 
-docs: 
+docs:
        $(MAKE) -C doc html
 
 docs-clean:
@@ -96,7 +101,7 @@ docs-check:
 
 comments:
        $(MAKE) -C doc comments
-       
+
 cheatsheets:
        $(MAKE) -C doc cheatsheets
 
@@ -132,7 +137,7 @@ raster-sql:
 
 astyle:
        ./astyle.sh
-    
+
 commit:
        $(MAKE) astyle && $(MAKE) clean && $(MAKE) check && svn commit
 
@@ -142,7 +147,7 @@ authors.git: authors.svn
 svnrebase: authors.git
        git svn rebase --authors-file authors.git
 
-postgis_svn_revision.h: 
+postgis_svn_revision.h:
        $(PERL) utils/svn_repo_revision.pl
 
 .PHONY: utils liblwgeom ChangeLog raster postgis_svn_revision.h