mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-23 11:29:46 +00:00
fab7609913
File types that we don't format automatically can end up with such basic untidiness as trailing whitespaces. Check for these. Remove all existing precedents.
32 lines
883 B
Bash
Executable File
32 lines
883 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright 2020 syzkaller project authors. All rights reserved.
|
|
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
|
|
|
|
FILES=0
|
|
FAILED=""
|
|
RE="[[:space:]]$"
|
|
LAST_EMPTY=""
|
|
for F in $(find . -name "*.sh" -o -name "*.S" -o -name "*.py" -o -name "*.yml" -o -name "*.yaml" -o -name "*.md" | \
|
|
egrep -v "/vendor/|/gen/"); do
|
|
((FILES+=1))
|
|
L=0
|
|
while IFS= read -r LINE; do
|
|
((L+=1))
|
|
if [[ $LINE =~ $RE ]]; then
|
|
echo "$F:$L:1: Trailing whitespace at the end of the line. Please remove."
|
|
echo "$LINE"
|
|
FAILED="1"
|
|
fi
|
|
LAST_EMPTY=""
|
|
if [ "$LINE" == "" ]; then
|
|
LAST_EMPTY="1"
|
|
fi
|
|
done < "$F"
|
|
if [ "$LAST_EMPTY" != "" ]; then
|
|
echo "$F:$L:1: Trailing empty line at the end of the file. Please remove."
|
|
FAILED="1"
|
|
fi
|
|
done
|
|
if [ "$FAILED" != "" ]; then exit 1; fi
|
|
echo "$FILES files checked for whitespaces"
|