Trailing whitespace detection script and circleci job.

This commit is contained in:
Daniel Kirchner 2018-09-04 17:17:07 +02:00
parent cc7daf7b47
commit 1cd96b2dc4
2 changed files with 27 additions and 0 deletions

View File

@ -179,6 +179,15 @@ jobs:
name: Check spelling
command: ~/.local/bin/codespell -S "*.enc,.git" -I ./scripts/codespell_whitelist.txt
test_trailing_whitespace:
docker:
- image: buildpack-deps:artful
steps:
- checkout
- run:
name: Check for trailing whitespace
command: ./scripts/detect_trailing_whitespace.sh
test_buglist:
docker:
- image: circleci/node
@ -263,6 +272,7 @@ workflows:
build_all:
jobs:
- test_check_spelling: *build_on_tags
- test_trailing_whitespace: *build_on_tags
- test_buglist: *build_on_tags
- build_emscripten: *build_on_tags
- test_emscripten_solcjs:

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
REPO_ROOT="$(dirname "$0")"/..
(
cd $REPO_ROOT
WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" | grep -v "test/libsolidity/ASTJSON\|test/compilationTests/zeppelin/LICENSE")
if [[ "$WHITESPACE" != "" ]]
then
echo "Error: Trailing whitespace found:" >&2
echo "\"$WHITESPACE\"" >&2
exit 1
else
exit 0
fi
)