]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Makefile.in: Add the whitespacecheck target
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 19 Dec 2022 19:52:33 +0000 (20:52 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 19 Dec 2022 20:04:18 +0000 (21:04 +0100)
Display errors when there are trailing space(s)/tab(s).

[skip ci]

CHANGES
Makefile.in

diff --git a/CHANGES b/CHANGES
index 1f4fd625b0ef3081de8df86455416c06ceaf1b05..742e64411ba81f2df01a7c44b5057dbe00307fb6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -45,6 +45,7 @@ Monthday, Month DD, YYYY by gharris and denis
       Cirrus CI: Add the "make releasecheck" command in the Linux task.
       CI: Introduce and use TCPDUMP_CMAKE_TAINTED.
       Makefile.in: Add "make -s install" in the releasecheck target.
+      Makefile.in: Add the whitespacecheck target.
 
 TBD
   Summary for 4.99.2 tcpdump release (so far!)
index 0054f05ff37a1fde38ddda90690727f376a54f14..2a99aec545279e1bdf15d533903fee2cf99c80d7 100644 (file)
@@ -526,6 +526,19 @@ releasecheck: releasetar
        rm -rf "$$INSTALL_DIR" && \
        echo '[$@] Done.'
 
+whitespacecheck:
+       @# trailing space(s)?
+       @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
+           echo 'Error: Trailing space(s).'; \
+           exit 1; \
+       fi
+       @# trailing tab(s)?
+       @# install-sh has a tab at the end of one line
+       @if git grep -I -n '    $$' $$(git ls-files|grep -vE '^(tests/|install-sh$$)'); then \
+           echo 'Error: Trailing tabs(s).'; \
+           exit 1; \
+       fi
+
 testlist:
        echo $(TEST_DIST)