From c1ca2bf9d290a4b3be6e8e06824957952aee8035 Mon Sep 17 00:00:00 2001 From: Nikola Matic Date: Tue, 11 Jul 2023 20:28:21 +0200 Subject: [PATCH] Check style coverage for using namespace std --- scripts/check_style.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/check_style.sh b/scripts/check_style.sh index 0953106d3..0d5fe1826 100755 --- a/scripts/check_style.sh +++ b/scripts/check_style.sh @@ -20,6 +20,10 @@ EXCLUDE_FILES=( EXCLUDE_FILES_JOINED=$(printf "%s\|" "${EXCLUDE_FILES[@]}") EXCLUDE_FILES_JOINED=${EXCLUDE_FILES_JOINED%??} +NAMESPACE_STD_FREE_FILES=( + libevmasm/* +) + ( REPO_ROOT="$(dirname "$0")"/.. cd "$REPO_ROOT" || exit 1 @@ -58,6 +62,9 @@ FORMATERROR=$( # unqualified move()/forward() checks, i.e. make sure that std::move() and std::forward() are used instead of move() and forward() preparedGrep "move\(.+\)" | grep -v "std::move" | grep -E "[^a-z]move" preparedGrep "forward\(.+\)" | grep -v "std::forward" | grep -E "[^a-z]forward" + # make sure `using namespace std` is not used in INCLUDE_DIRECTORIES + # shellcheck disable=SC2068,SC2068 + grep -nIE -d skip "using namespace std;" ${NAMESPACE_STD_FREE_FILES[@]} ) | grep -E -v -e "^[a-zA-Z\./]*:[0-9]*:\s*\/(\/|\*)" -e "^test/" || true )