From eb092d571ead69c8014e8267b6b9cb1558a21e97 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 5 Sep 2022 00:46:15 +0300 Subject: [PATCH 54/54] Add src-check against trailing spaces in most user files See osdn #45125 Signed-off-by: Marko Lindqvist --- tests/Makefile.am | 2 ++ tests/trailing_spaces.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 tests/trailing_spaces.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 2d0affa246..aab13afdd8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -10,6 +10,7 @@ src-check: $(srcdir)/fcintl.sh $(top_srcdir) >> check-output_ $(srcdir)/header_guard.sh $(top_srcdir) >> check-output_ $(srcdir)/va_list.sh $(top_srcdir) >> check-output_ + $(srcdir)/trailing_spaces.sh $(top_srcdir) >> check-output_ cat check-output_ | sed "s,$(top_srcdir)/,," > check-output rm -f check-output_ @@ -28,4 +29,5 @@ EXTRA_DIST = check_macros.sh \ rs_test_res/ruleset_list.txt \ rs_test_res/ruleset_loads.sh.in \ rulesets_autohelp.sh.in \ + trailing_spaces.sh \ va_list.sh diff --git a/tests/trailing_spaces.sh b/tests/trailing_spaces.sh new file mode 100755 index 0000000000..5f85b8d457 --- /dev/null +++ b/tests/trailing_spaces.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +files=$(find $1 -name "*.ruleset" \ + -o -name "*.tileset" \ + -o -name "*.spec" \ + -o -name "README*" | sort) + +echo "# Check for trailing spaces:" +for file in $files; do + COUNT=$(cat $file | grep "[ ]$" | wc -l) + if [ "$COUNT" != "0" ]; then + echo $file + fi +done +echo -- 2.35.1