presubmit: check for uppercase (#1774)

Another thing we can test automatically, we sorta settled on using an
uppercase letter in in t.Log and t.Fatal calls.

Let's just check for this.
This commit is contained in:
Miek Gieben
2018-05-07 22:47:25 +01:00
committed by Yong Tang
parent 15d989e294
commit 643550eabe
25 changed files with 104 additions and 90 deletions

14
.presubmit/test-lowercase Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
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
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
echo "** presubmit/$(basename $0): please start with an upper case letter when using t.Log*()"
exit 1
fi