From ef8cb40688067f918d05829b1f47bb938f70d2a7 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Sun, 20 Jan 2019 23:36:46 -0800 Subject: [PATCH] Add presubmit to check if there are any files that have `import "testing"` (#2480) The check is done through ``` if [[ $(go list -f '{{ join .Deps " "}}') == *" testing "* ]]; then error.. fi ``` Signed-off-by: Yong Tang --- .presubmit/import-testing | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 .presubmit/import-testing diff --git a/.presubmit/import-testing b/.presubmit/import-testing new file mode 100755 index 000000000..42d00bcfc --- /dev/null +++ b/.presubmit/import-testing @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "** presubmit/$(basename $0)" + +# Check to make sure "testing" is not imported +if [[ $(go list -f '{{ join .Deps " "}}') == *" testing "* ]]; then + echo "** presubmit/$(basename $0): please remove any 'import \"testing\"'" + exit 1 +fi