Pending TODO Script Checker in Codebase (#540)

* TODO script

* Add todo to Travis

* Remove blame from todo check

* Print failing todo comments

* Fail on failure

* Fix todo checker

* Don't install godeps

* *actually* don't install godeps
This commit is contained in:
Zach Zundel 2018-09-22 16:07:03 -06:00 committed by Preston Van Loon
parent 1988dd0d5d
commit f3774edeb1
2 changed files with 16 additions and 0 deletions

View File

@ -10,6 +10,12 @@ matrix:
script:
-
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./... --deadline=10m --exclude=client/internal/client_helper.go
- os: linux
env:
- todos
install: true # Skip installing go packages
script:
- ./scripts/check-todo.sh
- os: linux
env:
- coverage

10
scripts/check-todo.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# Continuous integration script to check that TODOs are in the correct format
OUTPUT="$(grep -PrinH '(?<!context\.)todo(?!\(#{0,1}\d+\))' --include \*.go *)";
if [ "$OUTPUT" != "" ] ;
then
echo "Invalid TODOs found. Failing." >&2;
echo "$OUTPUT" >&2;
exit 1;
fi