aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-05 00:20:57 +0800
committerGitHub <noreply@github.com>2018-09-05 00:20:57 +0800
commit8da1f25030b98bd230649c057f02ed3a23d899d1 (patch)
tree15cedda7c361529577f1afb5ad31f18d8b1fa58f
parent47f67f3567ba92b186594fec15d8400d4d9e753a (diff)
parent1ae6ec9038d83a82d5e8b57a8c6138dd4970d422 (diff)
downloaddexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar.gz
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar.bz2
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar.lz
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar.xz
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.tar.zst
dexon-solidity-8da1f25030b98bd230649c057f02ed3a23d899d1.zip
Merge pull request #4897 from ethereum/trailingWhitespaceDetection
Trailing whitespace detection script and circleci job.
-rw-r--r--.circleci/config.yml10
-rw-r--r--libsolidity/codegen/ExpressionCompiler.cpp2
-rwxr-xr-xscripts/detect_trailing_whitespace.sh15
3 files changed, 26 insertions, 1 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/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp
index 3e8b7337..a13b3e6c 100644
--- a/libsolidity/codegen/ExpressionCompiler.cpp
+++ b/libsolidity/codegen/ExpressionCompiler.cpp
@@ -1827,7 +1827,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
auto funKind = _functionType.kind();
solAssert(funKind != FunctionType::Kind::BareStaticCall || m_context.evmVersion().hasStaticCall(), "");
-
+
bool returnSuccessConditionAndReturndata = funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::BareStaticCall;
bool isCallCode = funKind == FunctionType::Kind::BareCallCode;
bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall;
diff --git a/scripts/detect_trailing_whitespace.sh b/scripts/detect_trailing_whitespace.sh
new file mode 100755
index 00000000..1a136a10
--- /dev/null
+++ b/scripts/detect_trailing_whitespace.sh
@@ -0,0 +1,15 @@
+#!/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
+fi
+)