mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10663 from ethereum/check_style_exclude_list_support
scripts/check_style.sh: add exclude list support.
This commit is contained in:
commit
7824ccb56d
@ -2,13 +2,19 @@
|
|||||||
|
|
||||||
. scripts/report_errors.sh
|
. scripts/report_errors.sh
|
||||||
|
|
||||||
|
EXCLUDE_FILES=(
|
||||||
|
"libsolutil/picosha2.h"
|
||||||
|
"test/libsolutil/UTF8.cpp"
|
||||||
|
)
|
||||||
|
EXCLUDE_FILES_JOINED=$(printf "%s\|" "${EXCLUDE_FILES[@]}")
|
||||||
|
EXCLUDE_FILES_JOINED=${EXCLUDE_FILES_JOINED%??}
|
||||||
|
|
||||||
(
|
(
|
||||||
REPO_ROOT="$(dirname "$0")"/..
|
REPO_ROOT="$(dirname "$0")"/..
|
||||||
cd $REPO_ROOT
|
cd $REPO_ROOT
|
||||||
|
|
||||||
WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" |
|
WHITESPACE=$(git grep -n -I -E "^.*[[:space:]]+$" |
|
||||||
grep -v "test/libsolidity/ASTJSON\|test/libsolidity/ASTRecoveryTests\|test/compilationTests/zeppelin/LICENSE" |
|
grep -v "test/libsolidity/ASTJSON\|test/libsolidity/ASTRecoveryTests\|test/compilationTests/zeppelin/LICENSE\|${EXCLUDE_FILES_JOINED}"
|
||||||
grep -v -E "test/libsolidity/syntaxTests/comments/unicode_direction_override_1.sol"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ "$WHITESPACE" != "" ]]
|
if [[ "$WHITESPACE" != "" ]]
|
||||||
@ -20,11 +26,10 @@ fi
|
|||||||
|
|
||||||
function preparedGrep()
|
function preparedGrep()
|
||||||
{
|
{
|
||||||
git grep -nIE "$1" -- '*.h' '*.cpp' | grep -v "picosha2.h"
|
git grep -nIE "$1" -- '*.h' '*.cpp' | grep -v "${EXCLUDE_FILES_JOINED}"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FORMATERROR=$(
|
FORMATERROR=$(
|
||||||
(
|
(
|
||||||
preparedGrep "#include \"" | egrep -v -e "license.h" -e "BuildInfo.h" # Use include with <> characters
|
preparedGrep "#include \"" | egrep -v -e "license.h" -e "BuildInfo.h" # Use include with <> characters
|
||||||
|
Loading…
Reference in New Issue
Block a user