forked from quic-go/quic-go
add a lint script to verify that Ginkgo is not imported
This commit is contained in:
24
.travis/no_ginkgo.sh
Executable file
24
.travis/no_ginkgo.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Verify that no non-test files import Ginkgo or Gomega.
|
||||
|
||||
set -e
|
||||
|
||||
HAS_TESTING=false
|
||||
|
||||
cd ..
|
||||
for f in $(find . -name "*.go" ! -name "*_test.go"); do
|
||||
if grep -q "github.com/onsi/ginkgo" $f; then
|
||||
echo "$f imports github.com/onsi/ginkgo"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
if grep -q "github.com/onsi/gomega" $f; then
|
||||
echo "$f imports github.com/onsi/gomega"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
done
|
||||
|
||||
if "$HAS_TESTING"; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
@@ -3,6 +3,7 @@
|
||||
set -ex
|
||||
|
||||
if [ ${TESTMODE} == "lint" ]; then
|
||||
.travis/no_ginkgo.sh
|
||||
./bin/golangci-lint run ./...
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user