From 4bb0b6defdf9f78507ba5646b64c4876f5b429d0 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 23 Jun 2019 17:44:48 -0400 Subject: check_whitespace: Add script to run whitespace checks Allow users to run the "travis ci" whitespace check directly from the command-line. Signed-off-by: Kevin O'Connor --- scripts/check_whitespace.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/check_whitespace.sh (limited to 'scripts/check_whitespace.sh') diff --git a/scripts/check_whitespace.sh b/scripts/check_whitespace.sh new file mode 100755 index 00000000..bd136d86 --- /dev/null +++ b/scripts/check_whitespace.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Script to check whitespace in Klipper source code. + +# Find SRCDIR from the pathname of this script +SRCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )" +cd ${SRCDIR} + +# Run whitespace tool on all source files +WS_DIRS="config/ docs/ klippy/ scripts/ src/ test/" +WS_EXCLUDE="-path scripts/kconfig -prune" +WS_FILES="-o -iname '*.[csh]' -o -name '*.py' -o -name '*.sh'" +WS_FILES="$WS_FILES -o -name '*.md' -o -name '*.cfg'" +WS_FILES="$WS_FILES -o -name '*.test' -o -name '*.config'" +WS_FILES="$WS_FILES -o -iname '*.lds' -o -iname 'Makefile' -o -iname 'Kconfig'" +eval find $WS_DIRS $WS_EXCLUDE $WS_FILES | xargs ./scripts/check_whitespace.py -- cgit v1.2.3-70-g09d2