Skip to content

Commit 8390a24

Browse files
authored
Merge pull request ethereum#14408 from ethereum/check-style-for-using-namespace-std-v2
Check style coverage for using namespace std
2 parents b29d8a4 + c1ca2bf commit 8390a24

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/check_style.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ EXCLUDE_FILES=(
2020
EXCLUDE_FILES_JOINED=$(printf "%s\|" "${EXCLUDE_FILES[@]}")
2121
EXCLUDE_FILES_JOINED=${EXCLUDE_FILES_JOINED%??}
2222

23+
NAMESPACE_STD_FREE_FILES=(
24+
libevmasm/*
25+
)
26+
2327
(
2428
REPO_ROOT="$(dirname "$0")"/..
2529
cd "$REPO_ROOT" || exit 1
@@ -58,6 +62,9 @@ FORMATERROR=$(
5862
# unqualified move()/forward() checks, i.e. make sure that std::move() and std::forward() are used instead of move() and forward()
5963
preparedGrep "move\(.+\)" | grep -v "std::move" | grep -E "[^a-z]move"
6064
preparedGrep "forward\(.+\)" | grep -v "std::forward" | grep -E "[^a-z]forward"
65+
# make sure `using namespace std` is not used in INCLUDE_DIRECTORIES
66+
# shellcheck disable=SC2068,SC2068
67+
grep -nIE -d skip "using namespace std;" ${NAMESPACE_STD_FREE_FILES[@]}
6168
) | grep -E -v -e "^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" -e "^test/" || true
6269
)
6370

0 commit comments

Comments
 (0)