From d247230aec951c66eb9d230469847237cbd844e2 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Wed, 12 Jan 2022 13:26:17 -0800 Subject: [PATCH] Add check for using namespace (#9383) Summary: As title. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9383 Test Plan: manually add `using namespace` to a file, and run `make check-sources`. Then, remove `using namespace`, and run `make check-sources` Reviewed By: ajkr Differential Revision: D33551706 Pulled By: riversand963 fbshipit-source-id: 1bb8304f38434da7de0656882e62e77673155725 --- build_tools/check-sources.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build_tools/check-sources.sh b/build_tools/check-sources.sh index 7e481ff89..588817588 100755 --- a/build_tools/check-sources.sh +++ b/build_tools/check-sources.sh @@ -23,6 +23,14 @@ if [ "$?" != "1" ]; then BAD=1 fi +git grep 'using namespace' -- ':!build_tools' ':!docs' \ + ':!third-party/folly/folly/lang/Align.h' \ + ':!third-party/gtest-1.8.1/fused-src/gtest/gtest.h' +if [ "$?" != "1" ]; then + echo '^^^^ Do not use "using namespace"' + BAD=1 +fi + if [ "$BAD" ]; then exit 1 fi