*: Use -n instead of ! -z. [SC2236]

Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
This commit is contained in:
Sam Batschelet
2019-01-08 17:02:40 +00:00
committed by Sam Batschelet
parent 442c863413
commit 2001786f02
2 changed files with 8 additions and 8 deletions

12
test
View File

@@ -115,7 +115,7 @@ fi
# determine the number of CPUs to use for Go tests
TEST_CPUS="1,2,4"
if [ ! -z "${CPU}" ]; then
if [ -n "${CPU}" ]; then
TEST_CPUS="${CPU}"
fi
echo "Running with TEST_CPUS:" "${TEST_CPUS}"
@@ -126,7 +126,7 @@ if [ "$GOARCH" == "amd64" ]; then
fi
RUN_ARG=""
if [ ! -z "${TESTCASE}" ]; then
if [ -n "${TESTCASE}" ]; then
RUN_ARG="-run=${TESTCASE}"
fi
@@ -381,7 +381,7 @@ function shellcheck_pass {
function markdown_you_pass {
# eschew you
yous=$(find . -name \*.md ! -path './vendor/*' ! -path './Documentation/v2/*' ! -path './gopath.proto/*' -exec grep -E --color "[Yy]ou[r]?[ '.,;]" {} + || true)
if [ ! -z "$yous" ]; then
if [ -n "$yous" ]; then
echo -e "found 'you' in documentation:\\n${yous}"
exit 255
fi
@@ -413,13 +413,13 @@ function goword_pass {
gofiles=($gofiles)
# only check for broken exported godocs
gowordRes=$(goword -use-spell=false "${gofiles[@]}" | grep godoc-export | sort)
if [ ! -z "$gowordRes" ]; then
if [ -n "$gowordRes" ]; then
echo -e "goword checking failed:\\n${gowordRes}"
exit 255
fi
# check some spelling
gowordRes=$(goword -ignore-file=.words clientv3/{*,*/*}.go 2>&1 | grep spell | sort)
if [ ! -z "$gowordRes" ]; then
if [ -n "$gowordRes" ]; then
echo -e "goword checking failed:\\n${gowordRes}"
exit 255
fi
@@ -663,7 +663,7 @@ function dep_pass {
badpkg="(etcdserver$|mvcc$|backend$|grpc-gateway)"
deps=$(go list -f '{{ .Deps }}' | sed 's/ /\n/g' | grep -E "${badpkg}" || echo "")
popd >/dev/null
if [ ! -z "$deps" ]; then
if [ -n "$deps" ]; then
echo -e "clientv3 has masked dependencies:\\n${deps}"
exit 255
fi