diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-04 23:17:07 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-04 23:36:47 +0800 |
commit | 1cd96b2dc482ed484e87de7c26a4af54aca45e1d (patch) | |
tree | e9ad333fa078f5208e9041e8fcc6e73b454a9238 | |
parent | cc7daf7b476f498c4dcde7bdb342974097ffe9bf (diff) | |
download | dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.gz dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.bz2 dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.lz dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.xz dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.tar.zst dexon-solidity-1cd96b2dc482ed484e87de7c26a4af54aca45e1d.zip |
Trailing whitespace detection script and circleci job.
-rw-r--r-- | .circleci/config.yml | 10 | ||||
-rwxr-xr-x | scripts/detect_trailing_whitespace.sh | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 4514626b..aec8be18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/scripts/detect_trailing_whitespace.sh b/scripts/detect_trailing_whitespace.sh new file mode 100755 index 00000000..78e69584 --- /dev/null +++ b/scripts/detect_trailing_whitespace.sh @@ -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 +) |