mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
presubmit: Check errorf as well (#1845)
Uppercase all these test errors as well. And extend the presubmit to check for these in the future. Also do a slightly smarter grep to only get t.<something>. as (because dump regexp) this also grep over non test files.
This commit is contained in:
@@ -3,12 +3,17 @@
|
||||
echo "** presubmit/$(basename $0)"
|
||||
|
||||
# Get the tests that call t.* without capitalizing the first char - seems we standardized on that.
|
||||
if egrep -r 't\.Fatal.?\("[a-z]' "$@"; then
|
||||
if egrep -r '\bt\.Fatal.?\("[a-z]' "$@"; then
|
||||
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Fatal*()"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if egrep -r 't\.Log.?\("[a-z]' "$@"; then
|
||||
if egrep -r '\bt\.Error.?\("[a-z]' "$@"; then
|
||||
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Error*()"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if egrep -r '\bt\.Log.?\("[a-z]' "$@"; then
|
||||
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Log*()"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user