vino/tools/whitespace_linter
Sean Eagan 0e2baf38e4 Generate api docs for CRD types
Change-Id: I803689985c0010b452f52bfe9a57bc5e910d051f
Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
2021-02-02 13:37:28 -06:00

12 lines
445 B
Bash
Executable File

#!/usr/bin/env bash
# git 1.9.0+ allows for exclusions in pathspecs via ':!foo' syntax.
# However, until git 2.13.0 there must be at least one "inclusive" pathspec, hence the './*'
trailing_whitespace=$(git grep -E -n -- ' +$' -- './*' ':!*.png' ':!docs/api/vino.md')
if [[ -n "$trailing_whitespace" ]]; then
printf "ERROR: Trailing whitespaces:\n"
awk 'BEGIN {FS=":"} {printf " * %s:%s\n", $1, $2}' <<< "$trailing_whitespace"
exit 1
fi